#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> V(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &V[i]);
  }
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
  }
  bool b = 0;
  vector<pair<int, int> > Q;
  for (int i = 0; i < n; ++i) Q.push_back(pair<int, int>(V[i], 0));
  sort(Q.begin(), Q.end());
  for (int i = 0; i < n; ++i) {
    Q[i].second = b;
    b = !b;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (V[i] == Q[j].first) {
        printf("%d ", Q[j].second);
        break;
      }
    }
  }
  return 0;
}
