#include <bits/stdc++.h>
using namespace std;
int n, m;
int b[1005];
struct xy {
  int x, id;
} a[1005];
bool cmp(xy a, xy b) { return a.x < b.x; }
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].x);
    a[i].id = i;
  }
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) b[a[i].id] = i % 2;
  for (int i = 1; i <= n; i++) printf("%d ", b[i]);
  printf("\n");
  return 0;
}
