#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x;
  int a[200];
  int b[200];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = i;
  }
  bool f = false;
  while (!f) {
    f = true;
    for (int i = 0; i < (n - 1); i++) {
      if (a[i] > a[i + 1]) {
        f = false;
        int swp = a[i + 1];
        a[i + 1] = a[i];
        a[i] = swp;
        swp = b[i + 1];
        b[i + 1] = b[i];
        b[i] = swp;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    a[b[i]] = i % 2;
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    cin >> x;
  }
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cin >> x;
  return 0;
}
