#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int maxn = 1005;
const int inf = 0x3f3f3f3f;
struct Node {
  int id, a;
  int val;
} node[maxn];
int cmp(const Node &x, const Node &y) { return x.a < y.a; }
int cmp1(const Node &x, const Node &y) { return x.id < y.id; }
int main() {
  int i, j, k, m, n, x;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &node[i].a);
      node[i].id = i;
    }
    int l, r;
    while (m--) scanf("%d%d", &l, &r);
    sort(node, node + n, cmp);
    for (i = 0; i < n; i++) node[i].val = i % 2;
    sort(node, node + n, cmp1);
    for (i = 0; i < n - 1; i++) printf("%d ", node[i].val);
    printf("%d\n", node[i].val);
  }
  return 0;
}
