#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, maxn = 205;
int n, a[maxn], ans[maxn], num[maxn], vis[maxn];
int main() {
  while (~scanf("%d", &n)) {
    memset(num, 0, sizeof(num));
    memset(ans, 0, sizeof(ans));
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= 2 * n; i++) {
      scanf("%d", &a[i]);
      num[a[i]]++;
    }
    int num0 = 0, num1 = 0, num2 = 0;
    for (int i = 1; i <= 2 * n; i++) {
      if (num[a[i]] >= 2) {
        if (!vis[a[i]])
          num0++, ans[i] = 1, vis[a[i]] = 1;
        else if (vis[a[i]] == 1)
          ans[i] = 2, vis[a[i]] = 2;
      } else {
        if (num1 > num2)
          ans[i] = 2, num2++;
        else
          ans[i] = 1, num1++;
      }
    }
    num1 += num0, num2 += num0;
    printf("%d\n", num1 * num2);
    for (int i = 1; i <= 2 * n; i++)
      if (vis[a[i]] == 2 && !ans[i]) {
        if (num1 < n)
          ans[i] = 1, num1++;
        else
          ans[i] = 2;
      }
    for (int i = 1; i <= 2 * n; i++)
      printf("%d%c", ans[i], i == 2 * n ? '\n' : ' ');
  }
}
