#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
struct Node {
  int val, id;
} node[N];
bool cmp1(Node lhs, Node rhs) { return lhs.val < rhs.val; }
bool cmp2(Node lhs, Node rhs) { return lhs.id < rhs.id; }
int main() {
  ios::sync_with_stdio(false);
  int a[N], n, m, x, y;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &node[i].val), node[i].id = i;
  for (int i = 0; i < m; i++) scanf("%d %d", &x, &y);
  sort(node, node + n, cmp1);
  for (int i = 0; i < n; i++) {
    node[i].val = (i & 1 ? 1 : 0);
  }
  sort(node, node + n, cmp2);
  for (int i = 0; i < n; i++) printf("%d ", node[i].val);
  printf("\n");
  return 0;
}
