#include <bits/stdc++.h>
using namespace std;
int n, m;
int res[1000];
vector<pair<int, int> > v;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    v.push_back(make_pair(x, i));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) res[v[i].second] = i % 2;
  for (int i = 0; i < n; i++) printf("%d ", res[i]);
  return 0;
}
