#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
};
bool comp(const point& a, const point& b) { return a.x < b.x; }
int main() {
  int n, m;
  cin >> n >> m;
  vector<point> v(n);
  for (int i = 0; i < n; ++i) {
    v[i].y = i;
    cin >> v[i].x;
  }
  sort(v.begin(), v.end(), comp);
  vector<int> real(n);
  for (int i = 0; i < n; ++i) {
    real[v[i].y] = i;
  }
  for (int i = 0; i < n; ++i) {
    if (i != 0) cout << ' ';
    cout << real[i] % 2;
  }
  cout << endl;
}
