#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i, l, r, m, n;
  cin >> n >> m;
  map<int, int> mp;
  int a[n], b[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]] = i;
  }
  sort(a, a + n);
  while (m--) cin >> l >> r;
  for (i = 0; i < n; i++) b[mp[a[i]]] = i % 2;
  for (i = 0; i < n; i++) cout << b[i] << " ";
  return 0;
}
