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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
bool less_vectors(const vector<long long>& a, const vector<long long>& b) {
  return a.size() < b.size();
}
struct Comparator {
  bool operator()(const std::pair<long long, long long>& lhs,
                  const std::pair<long long, long long>& rhs) const {
    if (lhs.first != rhs.first)
      return lhs.first < rhs.first;
    else
      return lhs.second < rhs.second;
  }
};
long long fastexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = ((res) % 1000000009 * (a) % 1000000009) % 1000000009;
    a = ((a) % 1000000009 * (a) % 1000000009) % 1000000009;
    b /= 2;
  }
  return res;
}
long long fastexpom(long long a, long long b, long long m) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = (((res) % m) * ((a) % m)) % m;
    a = (((a) % m) * ((a) % m)) % m;
    b /= 2;
  }
  return res;
}
long long modinv(long long a, long long m = 1000000009) {
  return fastexpom(a, m - 2, m);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  vector<long long> f(101, 0);
  vector<long long> v(2 * n);
  for (long long i = 0; i < 2 * n; i++) {
    long long a;
    cin >> a;
    v[i] = a;
    f[a]++;
  }
  vector<pair<long long, long long> > b;
  for (long long i = 10; i <= 99; i++) {
    if (f[i]) b.push_back(make_pair(f[i], i));
  }
  sort(b.rbegin(), b.rend());
  long long l1 = 0;
  long long l2 = 0;
  vector<long long> f1(101, 0);
  vector<long long> f2(101, 0);
  set<long long> v1;
  set<long long> v2;
  for (long long i = 0; i < b.size(); i++) {
    for (long long j = 0; j < b[i].first; j++) {
      if (v1.size() < v2.size()) {
        v1.insert(b[i].second);
        f1[b[i].second] = 1;
      } else {
        v2.insert(b[i].second);
        f2[b[i].second] = 1;
      }
    }
  }
  cout << v1.size() * v2.size() << "\n";
  vector<long long> ans(2 * n, 0);
  for (long long i = 0; i < 2 * n; i++) {
    if (v1.find(v[i]) != v1.end()) {
      ans[i] = 1;
      v1.erase(v[i]);
      l1++;
      continue;
    }
    if (v2.find(v[i]) != v2.end()) {
      ans[i] = 2;
      v2.erase(v[i]);
      l2++;
    }
  }
  for (long long i = 0; i < 2 * n; i++) {
    if (ans[i] == 0 && l1 < n) {
      ans[i] = 1;
      l1++;
      continue;
    }
    if (ans[i] == 0 && l2 < n) {
      ans[i] = 2;
      l2++;
    }
  }
  for (long long i = 0; i < 2 * n; i++) cout << ans[i] << " ";
  return 0;
}