#include <bits/stdc++.h>
using namespace std;
map<int, bool> lol;
int main() {
  int n, m;
  cin >> n >> m;
  int ar[n], ar2[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    ar2[i] = ar[i];
  }
  sort(ar, ar + n);
  bool x = 0;
  for (int i = 0; i < n; i++) {
    lol[ar[i]] = x;
    x = !x;
  }
  for (int i = 0; i < n; i++) {
    cout << lol[ar2[i]] << " ";
  }
  cout << endl;
}
