Problem: Valera has 2·n cubes, each cube contains an integer from 10 to 99. He arbitrarily chooses n cubes and puts them in the first heap. The remaining cubes form the second heap. 

Valera decided to play with cubes. During the game he takes a cube from the first heap and writes down the number it has. Then he takes a cube from the second heap and write out its two digits near two digits he had written (to the right of them). In the end he obtained a single fourdigit integer — the first two digits of it is written on the cube from the first heap, and the second two digits of it is written on the second cube from the second heap.

Valera knows arithmetic very well. So, he can easily count the number of distinct fourdigit numbers he can get in the game. The other question is: how to split cubes into two heaps so that this number (the number of distinct fourdigit integers Valera can get) will be as large as possible?

Input

The first line contains integer n (1 ≤ n ≤ 100). The second line contains 2·n space-separated integers ai (10 ≤ ai ≤ 99), denoting the numbers on the cubes.

Output

In the first line print a single number — the maximum possible number of distinct four-digit numbers Valera can obtain. In the second line print 2·n numbers bi (1 ≤ bi ≤ 2). The numbers mean: the i-th cube belongs to the bi-th heap in your division.

If there are multiple optimal ways to split the cubes into the heaps, print any of them.

Examples

Input

1
10 99


Output

1
2 1 


Input

2
13 24 13 45


Output

4
1 2 2 1 

Note

In the first test case Valera can put the first cube in the first heap, and second cube — in second heap. In this case he obtain number 1099. If he put the second cube in the first heap, and the first cube in the second heap, then he can obtain number 9910. In both cases the maximum number of distinct integers is equal to one.

In the second test case Valera can obtain numbers 1313, 1345, 2413, 2445. Note, that if he put the first and the third cubes in the first heap, he can obtain only two numbers 1324 and 1345.

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;
public class q14{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int i=0,j=0,n=0,k=0,a=0,b=0,c=0,r=0,p=0,q=0,s=0,t=0,test2=0;
		//System.out.println("jdvj");
		i=scan.nextInt();
		//int[] count = new int[26];
		//word = scan.nextLine();
		int m[] = new int[2*i];
		int mm[] = new int[2*i];
		float mmm[] = new float[2*i];
		int ff[] = new int[2*i];
		int f[] = new int[2*i];
		int rem=0;
		int cld=0,fnl=0;
		while(scan.hasNextInt())
		{	
			n=scan.nextInt();
			m[j] = n;
			mm[j] = j;
			mmm[j] =(float) n;
			j++;
			//rem=a;
		}
		quicksort(mmm, mm, 0, mm.length - 1);
		Arrays.sort(m);
		a=-1;
		for(j=0;j<2*i;j++)
		{	if(p<=s)		
			{	if(m[j] == a)
				{	if(m[j] == b)
					{	if(q<=r)
						{	f[j]=1;
							p++;
							a=m[j];
							q++;
						}
						else
						{	s++;
							r++;
							f[j] = 2;
							b=m[j];
						}
					}
					else
					{	s++;
						f[j] = 2;
						b=m[j];
					}
				}
				else
				{	f[j]=1;
					p++;
					a=m[j];
				}
			}
			else
			{	if(m[j] == b)
				{	if(m[j] == a)
					{	
						if(q<r)
						{	f[j]=1;
							p++;
							a=m[j];
							q++;
						}
						else
						{	s++;
							r++;
							f[j] = 2;
							b=m[j];
						}
					}
					else
					{	
						p++;
						f[j] = 1;
						a=m[j];
					}
				}
				else
				{	f[j]=2;
					s++;
					b=m[j];
				}
			}
			//System.out.printf(f[j]+" ");
			
		}
		//System.out.println();
		System.out.println((i-q)*(i-r));
		for(j=0;j<2*i;j++)
		{	for(k=0;k<2*i;k++)
			{	if(mm[k] == j)
					break;
			}
			System.out.printf(f[k]+" ");
		}	
		System.out.println();
//		for(j=0;j<2*i;j++)
//		{	
//			System.out.printf(mm[j]+" ");
//		}	
//		System.out.println();
//		for(j=0;j<2*i;j++)
//		{	
//			System.out.printf(f[j]+" ");
//		}	
//		System.out.println();
//		for(j=0;j<2*i;j++)
//		{	
//			System.out.printf(m[j]+" ");
//		}	
//		System.out.println();
	}
	public static void quicksort(float[] main, int[] index) {
		
	}

	// quicksort a[left] to a[right]
	public static void quicksort(float[] a, int[] index, int left, int right) {
		if (right <= left) return;
		int i = partition(a, index, left, right);
		quicksort(a, index, left, i-1);
		quicksort(a, index, i+1, right);
	}

	// partition a[left] to a[right], assumes left < right
	private static int partition(float[] a, int[] index, 
	int left, int right) {
		int i = left - 1;
		int j = right;
		while (true) {
		    while (less(a[++i], a[right]))      // find item on left to swap
		        ;                               // a[right] acts as sentinel
		    while (less(a[right], a[--j]))      // find item on right to swap
		        if (j == left) break;           // don't go out-of-bounds
		    if (i >= j) break;                  // check if pointers cross
		    exch(a, index, i, j);               // swap two elements into place
		}
		exch(a, index, i, right);               // swap with partition element
		return i;
	}

	// is x < y ?
	private static boolean less(float x, float y) {
		return (x < y);
	}

	// exchange a[i] and a[j]
	private static void exch(float[] a, int[] index, int i, int j) {
		float swap = a[i];
		a[i] = a[j];
		a[j] = swap;
		int b = index[i];
		index[i] = index[j];
		index[j] = b;
	}
}