#include <bits/stdc++.h>
using namespace std;
int maxx[101];
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  int aa[2 * m];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    maxx[a[i]] = 1;
  }
  for (int i = 0; i < 2 * m; i++) {
    cin >> aa[i];
  }
  int last = 0;
  for (int i = 0; i < 101; i++) {
    if (maxx[i] == 1) {
      maxx[i] = (last + 1) % 2;
      last = (last + 1) % 2;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << maxx[a[i]] << " ";
  }
}
