#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, len1, len2, counter1 = 0;
  int A[101] = {0}, B[101] = {0}, C[101][2] = {0};
  map<int, int> mymap;
  cin >> n >> m;
  len1 = n;
  len2 = m;
  while (len1 != 0) {
    cin >> A[counter1];
    B[counter1] = A[counter1];
    counter1++;
    len1--;
  }
  counter1 = 0;
  while (len2 != 0) {
    cin >> C[counter1][0] >> C[counter1][1];
    counter1++;
    len2--;
  }
  sort(B, B + n);
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      mymap[B[i]] = 1;
    } else {
      mymap[B[i]] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << mymap[A[i]] << " ";
  }
}
