#include <bits/stdc++.h>
using namespace std;
pair<int, int> x[1111];
int col[1111];
int main() {
  int n, m, i, s, t, u;
  while (scanf("%d%d", &n, &m) == 2) {
    for (i = 0; i < n; i++) {
      scanf("%d", &x[i].first);
      x[i].second = i;
    }
    sort(x, x + n);
    while (m--) scanf("%d%d", &s, &t);
    for (i = 0; i < n; i++) {
      u = x[i].second;
      col[u] = i & 1;
    }
    for (i = 0; i < n; i++) {
      if (i == n - 1)
        printf("%d\n", col[i]);
      else
        printf("%d ", col[i]);
    }
  }
}
