#include <bits/stdc++.h>
using namespace std;
namespace p353BTwoHeaps {
int res[222], x[222];
vector<int> pos[111];
void solve(int test_num) {
  int N;
  cin >> N;
  for (int i = 0; i < N + N; i++) {
    cin >> x[i];
    pos[x[i]].push_back(i);
  }
  int A = 0, B = 0;
  for (int i = 0; i < 100; i++) {
    if (pos[i].size() >= 2u) {
      A++, B++;
      res[pos[i][0]] = 1;
      res[pos[i][1]] = 2;
    }
    if (pos[i].size() == 1u) {
      if (A < B)
        res[pos[i][0]] = 1, A++;
      else
        res[pos[i][0]] = 2, B++;
    }
  }
  cout << (A * B) << endl;
  for (int i = 0; i < N + N; i++) {
    if (res[i] == 0) {
      if (A < B)
        res[i] = 1, A++;
      else
        res[i] = 2, B++;
    }
    cout << res[i] << ' ';
  }
}
void solve() { solve(1); }
}  // namespace p353BTwoHeaps
int main() {
  p353BTwoHeaps::solve();
  return 0;
}
