#include <bits/stdc++.h>
using namespace std;
int p[202];
bool vis[10000];
vector<int> G[100], x, y;
struct node {
  int k, id;
} num[100];
bool cmp(node a, node b) { return a.k < b.k; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 100; ++i) num[i].id = i;
  for (int i = 0; i < n * 2; ++i) {
    int x;
    cin >> x;
    num[x].k++;
    G[x].push_back(i);
  }
  int a = 0, b = 0;
  sort(num, num + 100, cmp);
  for (int i = 10; i < 100; ++i)
    for (int j = 0; j < G[num[i].id].size(); ++j) {
      if (a <= b)
        x.push_back(i), a++, p[G[num[i].id][j]] = 1;
      else
        y.push_back(i), b++, p[G[num[i].id][j]] = 2;
    }
  int ans = 0;
  for (int i = 0; i < x.size(); ++i)
    for (int j = 0; j < y.size(); ++j)
      if (!vis[x[i] * 100 + y[j]]) vis[x[i] * 100 + y[j]] = true, ans++;
  cout << ans << endl;
  for (int i = 0; i < n * 2; ++i) cout << p[i] << ' ';
  cout << endl;
  return 0;
}
