#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second < b.second; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i].first), v[i].second = i;
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) v[i].first = i & 1 ? 0 : 1;
  sort(v.begin(), v.end(), cmp);
  for (int i = 0; i < n; i++) printf("%d%c", v[i].first, " \n"[i == n - 1]);
  return 0;
}
