#include <bits/stdc++.h>
using namespace std;
struct point {
  int num;
  int set;
} a[1000];
bool cmp(point a, point b) { return a.num < b.num; }
int main() {
  int n, m;
  int i, j;
  int l[1000], r[1000];
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].num);
    a[i].set = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (i = 1; i <= m; i++) scanf("%d%d", &l[i], &r[i]);
  for (i = 1; i <= n; i++) a[i].num = i % 2;
  for (i = 1; i <= n; ++i) {
    if (i != 1) printf(" ");
    for (j = 1; j <= n; ++j) {
      if (i == a[j].set) {
        printf("%d", a[j].num);
        break;
      }
    }
  }
  printf("\n");
  return 0;
}
