#include <bits/stdc++.h>
using namespace std;
int n, m;
struct Point {
  int x, col, id;
} a[105];
bool cmpbyid(Point a, Point b) { return a.id < b.id; }
bool cmpbyx(Point a, Point b) { return a.x < b.x; }
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d%", &a[i].x);
      a[i].id = i;
    }
    while (m--) {
      int l, r;
      scanf("%d%d", &l, &r);
    }
    sort(a + 1, a + 1 + n, cmpbyx);
    for (int i = 1; i <= n; i++) {
      a[i].col = a[i - 1].col ^ 1;
    }
    sort(a + 1, a + 1 + n, cmpbyid);
    for (int i = 1; i <= n; i++) printf(i == n ? "%d\n" : "%d ", a[i].col);
  }
  return 0;
}
