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.*;

/**
 * @author artyom
 */
public class TwoHeaps {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] numbers = new int[2 * n];
        for (int i = 0; i < numbers.length; i++) {
            numbers[i] = sc.nextInt();
        }
        int[] nCopy = numbers.clone();
        Arrays.sort(nCopy);
        Map<Integer, Integer> g = group(nCopy);
        Set<Integer> firstHeap = new HashSet<>();
        Set<Integer> secondHeap = new HashSet<>();
        int[] heaps = divideIntoHeaps(numbers, g, firstHeap, secondHeap);
        System.out.println(firstHeap.size() * secondHeap.size());
        System.out.println(join(heaps, ' '));
    }

    private static int[] divideIntoHeaps(int[] numbers,
                                         Map<Integer, Integer> g,
                                         Set<Integer> firstHeap,
                                         Set<Integer> secondHeap) {
        int[] heaps = new int[numbers.length];
        for (int i = 0, m = 1, f = 0, s = 0, p = 0, q = 0; i < heaps.length; i++) {
            if (g.containsKey(numbers[i])) {
                if (g.get(numbers[i]) > 0) {
                    int t = g.get(numbers[i]);
                    addToHeap(numbers[i], heaps[i] = t % 2 + 1, firstHeap, secondHeap);
                    g.put(numbers[i], t - 1);
                    if (heaps[i] == 1) {
                        p++;
                    } else {
                        q++;
                    }
                } else {
                    if ((m == 1 && p == numbers.length / 2) || (m == 2 && q == numbers.length / 2)) {
                        m = nextHeap(m);
                    }
                    addToHeap(numbers[i], heaps[i] = m, firstHeap, secondHeap);
                    m = nextHeap(m);
                    if (heaps[i] == 1) {
                        p++;
                    } else {
                        q++;
                    }
                }
            } else {
                int k = (f <= s) ? 1 : 2;
                if ((k == 1 && p == numbers.length / 2) || (k == 2 && q == numbers.length / 2)) {
                    k = nextHeap(k);
                }
                if (k == 1) {
                    heaps[i] = 1;
                    f++;
                    p++;
                } else {
                    heaps[i] = 2;
                    s++;
                    q++;
                }
                addToHeap(numbers[i], heaps[i], firstHeap, secondHeap);
            }
        }
        return heaps;
    }

    private static void addToHeap(int number, int heapNumber,
                                  Set<Integer> firstHeap, Set<Integer> secondHeap) {
        if (heapNumber == 1) {
            firstHeap.add(number);
        } else {
            secondHeap.add(number);
        }
    }

    private static Map<Integer, Integer> group(int[] a) {
        Map<Integer, Integer> g = new HashMap<>();
        int c = 1;
        int t = a[0];
        for (int i = 1; i < a.length; i++, c++) {
            if (a[i] != t) {
                put(g, c, t);
                t = a[i];
                c = 0;
            }
        }
        put(g, c, t);
        return g;
    }

    private static void put(Map<Integer, Integer> group, int count, int entry) {
        if (!isEven(count)) {
            count--;
        }
        if (count > 0) {
            group.put(entry, count);
        }
    }

    private static boolean isEven(int a) {
        return a % 2 == 0;
    }

    private static int nextHeap(int heapNumber) {
        return (heapNumber == 1) ? 2 : 1;
    }

    private static String join(int[] r, char c) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0, n = r.length - 1; i <= n; i++) {
            sb.append(r[i]);
            if (i < n) {
                sb.append(c);
            }
        }
        return sb.toString();
    }
}