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:
//package div2.r205;

//package round205;
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.nio.file.*;
import java.util.*;

 

public class B {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	String INPUTFILE = "C:\\Users\\lenovo\\Desktop\\input.txt";
	
	public static List<Node> nodes;
	
	void solve()
	{
		nodes = new ArrayList<Node>();
		Set<Integer> set1 = new HashSet<Integer>();
		Set<Integer> set2 = new HashSet<Integer>();
		
		int n = ni();
		int[] a = na(2*n);
		for (int i = 0; i < 2 * n; i ++) {
			nodes.add(new Node(a[i], i));
		}
		int[] count = new int[100];
		for(int i = 0;i < 2*n;i++){
			count[a[i]]++;
		}
		
		Collections.sort(nodes, new CmpVal());
		
		// Step1�����ڸ�����ڵ���2�����֣�ƽ��ֵ���������set��
		int idx = 0;
		while (idx < 2 * n) {
			int val = nodes.get(idx).val;
			int num = count[val];
			if (num == 1) { // �ݲ�����
				nodes.get(idx).unique = true;
				idx ++;
				continue;
			}
			int todo = num;
			if (todo % 2 == 1) {
				todo --;
			}
			for (int i = idx; i < idx + todo; i ++) {
				if (i % 2 == 0) {
					nodes.get(i).belong = 1;
					set1.add(nodes.get(i).val);
				} else {
					nodes.get(i).belong = 2;
					set2.add(nodes.get(i).val);
				}
				nodes.get(i).vis = true;
			}
			idx += num;
		}
		// ��ĿǰΪֹ������set�е�Ԫ�ظ������
		
		// Step2�����ڳ�ʼ����ֻ��һ����Ԫ�أ�ƽ��ŵ�����set��
		int curBelong = 1;
		for (int i = 0; i < 2 * n; i ++) {
			if (nodes.get(i).unique == false) { // ֻ�����ʼ����Ϊ1��node
				continue;
			}
			nodes.get(i).belong = curBelong;
			nodes.get(i).vis = true;
			if (curBelong == 1) {
				set1.add(nodes.get(i).val);
			} else {
				set2.add(nodes.get(i).val);
			}
			curBelong = curBelong == 1 ? 2 : 1;
		}
		// ��ĿǰΪֹ������set�е�Ԫ�ؿ��ܲ����
		
		// Step3������һ����ʣ�µ�node����
		for (int i = 0; i < 2 * n; i ++) {
			if (nodes.get(i).vis) {
				continue;
			}
			nodes.get(i).belong = curBelong;
			if (curBelong == 1) {
				set1.add(nodes.get(i).val);
			} else {
				set2.add(nodes.get(i).val);
			}
			curBelong = curBelong == 1 ? 2 : 1;
		}
		
		// 
		int comb = set1.size() * set2.size();
		out.println(comb);
		
		Collections.sort(nodes, new CmpIdx());
		for (int i = 0; i < 2 * n; i ++) {
			out.print(nodes.get(i).belong);
			if (i + 1 == 2 * n) {
				out.print("\n");
			} else {
				out.print(" ");
			}
		}
	}
	
	void run() throws Exception
	{
		Path path = Paths.get(INPUTFILE);
		is = oj ? System.in : new ByteArrayInputStream(Files.readAllBytes(path));
//		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}
	
	public static void main(String[] args) throws Exception { new B().run(); }
	
	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

class CmpVal implements Comparator {

	 public int compare(Object arg0, Object arg1) {
	  Node n1 = (Node)arg0;
	  Node n2 = (Node)arg1;

	  return n1.val - n2.val;
	 }
}

class CmpIdx implements Comparator {

	 public int compare(Object arg0, Object arg1) {
	  Node n1 = (Node)arg0;
	  Node n2 = (Node)arg1;

	  return n1.idx - n2.idx;
	 }
}
	 
class Node {
	public int val, idx, belong;
	public boolean unique, vis;
	
	Node(int val, int idx) {
		this.val = val;
		this.idx = idx;
		this.unique = false;
		this.vis = false;
	}
}