#include <bits/stdc++.h>
using namespace std;
int Compare(const void *elem1, const void *elem2) {
  return *((int *)(elem1)) - *((int *)(elem2));
}
int x[110], l[110], r[110], tmp[110], ans[110];
int main() {
  int n, m, i, j;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> x[i];
    tmp[i] = x[i];
  }
  qsort(tmp, n, sizeof(int), Compare);
  for (i = 0; i < m; i++) cin >> l[i] >> r[i];
  for (i = 0; i < n; i = i + 2) ans[tmp[i]] = 1;
  for (i = 0; i < n; i++) cout << ans[x[i]] << " ";
  return 0;
}
