#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
struct P {
  int x, id, c;
} p[maxn];
bool cmp1(P p1, P p2) { return p1.id < p2.id; }
bool cmp2(P p1, P p2) { return p1.x < p2.x; }
int main(int argc, char *argv[]) {
  int n, m, x, l, r;
  while (scanf("%d %d", &n, &m) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &p[i].x);
      p[i].id = i;
    }
    for (int i = 0; i < m; i++) {
      scanf("%d %d", &l, &r);
    }
    sort(p, p + n, cmp2);
    for (int i = 0; i < n; i++) {
      if (i & 1) {
        p[i].c = 1;
      } else {
        p[i].c = 0;
      }
    }
    sort(p, p + n, cmp1);
    for (int i = 0; i < n; i++) {
      if (i != 0) {
        printf(" ");
      }
      printf("%d", p[i].c);
    }
    puts("");
  }
  return 0;
}
