#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int p[200];
int ans[200];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    mp[p[i]] = i;
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      ans[mp[p[i]]] = 1;
    } else
      ans[mp[p[i]]] = 0;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
