#include <bits/stdc++.h>
using namespace std;
using db = long double;
using pll = pair<long long, long long>;
int n, sum, arr[201], b[201], c[201];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, i, x, j, y, z, k, n;
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> arr[i];
    b[arr[i]]++;
    if (b[arr[i]] <= 2) sum++;
  }
  set<long long> s;
  k = 1;
  for (int i = 10; i < 100; i++)
    if (b[i] >= 2)
      for (int j = 1; j <= 2 * n; j++)
        if (arr[j] == i) c[j] = k, k = 3 - k;
  for (int i = 1; i <= 2 * n; i++)
    if (!c[i]) c[i] = k, k = 3 - k;
  for (i = 1; i < 2 * n + 1; i += 1) {
    if (c[i] == 1) {
      for (j = 1; j < 2 * n + 1; j += 1)
        if (c[j] == 2) {
          s.insert(arr[i] * 100 + arr[j]);
        }
    }
  }
  cout << s.size() << '\n';
  for (int i = 1; i <= 2 * n; i++) printf("%d ", c[i]);
}
