#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, t = 1, a[101], b[101][2], ans[101];
  cin >> n >> m;
  for (int i = 0; i < 101; i++) {
    b[i][0] = 0;
    ans[i] = -1;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]][0] = 1;
    b[a[i]][1] = i;
  }
  for (int i = 0; i < 101; i++) {
    if (b[i][0] == 1) {
      ans[b[i][1]] = t;
      t++;
      if (t == 2) t = 0;
    }
  }
  for (int i = 0; i < 101; i++)
    if (ans[i] != -1) cout << ans[i] << " ";
  return 0;
}
