#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
const int mdx = 1e3 + 10;
const int mx = 50 + 10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int mp[4][2] = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
const int to[3][6] = {
    {1, -1, 0, 0, 0, 0}, {0, 0, 1, -1, 0, 0}, {0, 0, 0, 0, 1, -1}};
const int tot[2] = {-1, 1};
const double eps = 1e-8;
const double pi = acos(-1.0);
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
struct X {
  int s;
  int id;
} x[maxn];
int cmpx(X a, X b) { return a.s < b.s; }
int cmpy(X a, X b) { return a.id < b.id; }
int main() {
  int p, y;
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i].s);
    x[i].id = i;
  }
  sort(x + 1, x + n + 1, cmpx);
  for (int i = 1; i <= m; i++) scanf("%d%d", &p, &y);
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0)
      x[i].s = 1;
    else
      x[i].s = 0;
  }
  sort(x + 1, x + n + 1, cmpy);
  for (int i = 1; i < n; i++) {
    printf("%d ", x[i].s);
  }
  printf("%d\n", x[n].s);
  return 0;
}
