#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, c[100], h[100];
bool cmp(int x, int y) {
  if (c[x] > c[y]) return 1;
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    h[i] = i;
  }
  for (int i = 0; i < m; i++) cin >> a >> b;
  sort(h, h + n, cmp);
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      c[h[i]] = 1;
    else
      c[h[i]] = 0;
  }
  for (int i = 0; i < n; i++) cout << c[i] << " ";
}
