#include <bits/stdc++.h>
using namespace std;
const int N = 110;
struct POINT {
  int x;
  int id;
  int v;
} point[N];
bool cmp1(POINT a, POINT b) { return a.x < b.x; }
bool cmp2(POINT a, POINT b) { return a.id < b.id; }
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &point[i].x);
      point[i].id = i;
    }
    int a, b;
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &a, &b);
    }
    sort(point, point + n, cmp1);
    for (int i = 0; i < n; i++) {
      point[i].v = i % 2;
    }
    sort(point, point + n, cmp2);
    for (int i = 0; i < n; i++) {
      printf("%d", point[i].v);
      if (i != n) {
        printf(" ");
      }
    }
    printf("\n");
  }
  return 0;
}
