#include <bits/stdc++.h>
using namespace std;
const int N = 205;
int dp[N][N][N], n, counts[N], a[N], pre[N][N][N];
int belong[N], need[N];
vector<int> rec;
void output(int i, int j, int k) {
  if (i == 0) return;
  int val = rec[i - 1];
  need[val] = pre[i][j][k];
  int add = pre[i][j][k] ? 1 : 0;
  output(i - 1, j - pre[i][j][k], k - add);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n << 1; i++) {
    scanf("%d", &a[i]);
    counts[a[i]]++;
  }
  for (int i = 10; i < 100; i++)
    if (counts[i]) rec.push_back(i);
  memset(dp, 0xc0, sizeof(dp));
  dp[0][0][0] = 0;
  int ans = 0;
  for (int i = 0; i < (int)rec.size(); i++) {
    int m = counts[rec[i]];
    for (int j = 0; j <= n; j++)
      for (int k = 0; k <= n; k++) {
        if (dp[i][j][k] == 0xc0c0c0c0) continue;
        for (int a = 0; a <= m && j + a <= n; a++) {
          int addb = m - a ? 1 : 0;
          int adda = a ? 1 : 0;
          if (dp[i + 1][j + a][k + adda] < dp[i][j][k] + addb) {
            dp[i + 1][j + a][k + adda] = dp[i][j][k] + addb;
            pre[i + 1][j + a][k + adda] = a;
          }
        }
      }
  }
  int size = (int)rec.size();
  int how = -1;
  for (int k = 0; k <= n; k++) {
    if (dp[size][n][k] == 0xc0c0c0c0) continue;
    if (ans < dp[size][n][k] * k) {
      ans = dp[size][n][k] * k;
      how = k;
    }
  }
  output(size, n, how);
  for (int i = 0; i < n << 1; i++) {
    int x = a[i];
    if (need[x])
      need[x]--, belong[i] = 1;
    else
      belong[i] = 2;
  }
  printf("%d\n", ans);
  n <<= 1;
  for (int i = 0; i < n; i++)
    printf("%d%c", belong[i], i == n - 1 ? '\n' : ' ');
  return 0;
}
