#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, n, m;
  cin >> n >> m;
  vector<pair<int, int> > v;
  vector<int> res(n);
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(make_pair(x, i));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (i % 2 != 0)
      res[v[i].second] = 0;
    else
      res[v[i].second] = 1;
  }
  for (int i = 0; i < n; i++) {
    cout << res[i];
    if (i != n - 1) cout << " ";
  }
  cout << endl;
  return 0;
}
