#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> n >> m;
  vector<pair<int, int> > v[102];
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v[a].push_back(pair<int, int>(i, 0));
  }
  int c = 0;
  int res[102];
  for (int i = 0; i < 102; i++) {
    for (int j = 0; j < v[i].size(); j++) {
      res[v[i][j].first] = c;
      c = c ^ 1;
    }
  }
  for (int i = 0; i < n; i++) cout << res[i] << " ";
  return 0;
}
