#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[108], b[108];
  int n, m;
  int i, j;
  int a1, b1;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 0; i < n; i++) {
      cin >> a[i];
      b[i] = a[i];
    }
    for (i = 0; i < m; i++) cin >> a1 >> b1;
    sort(b, b + n);
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++)
        if (a[i] == b[j]) cout << (j + 1) % 2 << ' ';
    cout << endl;
  }
  return 0;
}
