#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n, m;
  cin >> n >> m;
  map<int, int> xs;
  vector<int> ys;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    xs[t] = i;
    ys.push_back(t);
  }
  int j = 0;
  for (auto it = xs.begin(); it != xs.end(); it++) {
    it->second = j;
    j += 1;
  }
  for (int i = 0; i < n; i++) {
    cout << (xs[ys[i]] % 2) << " ";
  }
  return 0;
}
