import java.util.Scanner;

public class Section034_Type1 {
	public static void main(String[] args) {
		Scanner scanf = new Scanner(System.in);
		int m, n, i, j;
		int jumsu[] = new int[10];
		int rank[] = new int[10];
		m = -1;
		do
		{
			m++;
			jumsu[m] = scanf.nextInt();
		} while (m < 9);
		n = 9;
		i = 0;
		while (i <= n)
		{
			rank[i] = 1;
			i++;
		}
		i = 0;
		while (i <= n)
		{
			j = 0;
			while (j <= n)
			{
				if (jumsu[i] < jumsu[j])
					rank[i]++;
				j++;
			}
			i++;
		}
		for (int x = 0; x < 10; x++)
			System.out.printf("%d ", jumsu[x]);
		System.out.printf("\n");
		for (int x = 0; x < 10; x++)
			System.out.printf("%d ", rank[x]);
		scanf.close();
	}
}