#include <bits/stdc++.h>
using namespace std;
int a[205];
int v[205];
int b[205];
int main() {
  int i, j, k, n;
  while (cin >> n) {
    for (i = 0; i <= 99; i++) b[i] = v[i] = 0;
    int sum = 0;
    for (i = 0; i < 2 * n; i++) {
      cin >> a[i];
      v[a[i]]++;
    }
    int s1 = 0;
    int s2 = 0;
    int f = 1;
    for (i = 10; i <= 99; i++) {
      if (v[i] >= 2) {
        s1++;
        s2++;
      } else if (v[i] == 1) {
        if (f) {
          s1++;
          f = 0;
        } else {
          s2++;
          f = 1;
        }
      }
    }
    cout << s1 * s2 << endl;
    f = 1;
    s1 = 0;
    s2 = 0;
    for (i = 0; i < 2 * n; i++) {
      if ((v[a[i]] >= 2) && (s1 < n)) {
        b[i] = 1;
        s1++;
        v[a[i]] = -1;
        for (j = i + 1; j < 2 * n; j++) {
          if (a[j] == a[i]) {
            b[j] = 2;
            break;
          }
        }
      } else if (v[a[i]] == 1) {
        if (f) {
          b[i] = 1;
          f = 0;
          s1++;
        } else {
          b[i] = 2;
          f = 1;
        }
      }
    }
    if (s1 < n) {
      for (i = 0; i < 2 * n; i++) {
        if (!b[i]) {
          b[i] = 1;
          s1++;
        }
        if (s1 == n) break;
      }
    }
    for (i = 0; i < 2 * n; i++) {
      if (b[i])
        cout << b[i];
      else {
        cout << 2;
      }
      cout << " ";
    }
    cout << endl;
  }
}
