#include <bits/stdc++.h>
using namespace std;
bool a[200];
int b[200];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    v.push_back(p);
    a[p] = 1;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
  }
  int k = 0;
  for (int i = 0; i < 200; i++)
    if (a[i]) {
      b[i] = k;
      k = (k + 1) % 2;
    }
  for (int i = 0; i < n; i++) cout << b[v[i]] << " ";
  cout << endl;
  int pp;
  cin >> pp;
}
