#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v(n);
  for (int i = 1; i <= n; i++) {
    int val;
    cin >> val;
    v[i - 1] = {val, i};
  }
  for (int i = 1; i <= m; i++) {
    int l, r;
    cin >> l >> r;
  }
  sort(v.begin(), v.end());
  int ans[n + 1];
  for (int i = 0; i < n; i++) {
    if (i % 2)
      ans[v[i].second] = 1;
    else
      ans[v[i].second] = 0;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
