#include <bits/stdc++.h>
struct node {
  int val, id, ans;
} a[111];
int cmp(node a, node b) { return a.val < b.val; }
int cmp2(node a, node b) { return a.id < b.id; }
using namespace std;
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i].val), a[i].id = i;
    }
    sort(a, a + n, cmp);
    int z, zz;
    for (int i = 0; i < m; i++) {
      scanf("%d %d", &z, &zz);
    }
    for (int i = 0; i < n; i++) {
      if (i & 1)
        a[i].ans = 0;
      else
        a[i].ans = 1;
    }
    sort(a, a + n, cmp2);
    for (int i = 0; i < n; i++) printf("%d ", a[i].ans);
    printf("\n");
  }
  return 0;
}
