#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, order;
};
struct seg {
  int l, r;
};
bool compare(point a, point b) { return a.x < b.x; }
int main() {
  int pointnum, segnum, i, result[100], tmp[100];
  point p[100];
  seg s[100];
  cin >> pointnum;
  cin >> segnum;
  for (i = 0; i < pointnum; i++) {
    cin >> p[i].x;
    p[i].order = i;
  }
  sort(p, p + pointnum, compare);
  for (i = 0; i < segnum; i++) cin >> s[i].l >> s[i].r;
  for (i = 0; i < pointnum; i++) {
    if (i % 2 == 0) {
      tmp[i] = 0;
    } else
      tmp[i] = 1;
  }
  for (i = 0; i < pointnum; i++) {
    result[p[i].order] = tmp[i];
  }
  for (i = 0; i < pointnum; i++) {
    cout << result[i] << " ";
  }
  return 0;
}
