#include <bits/stdc++.h>
using namespace std;
int C[100 + 5], A[100 + 5], ind[100 + 5];
bool comp(int x, int y) { return A[x] < A[y]; }
int main() {
  int n, m, x, y;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
    ind[i] = i;
  }
  for (int i = 0; i < m; ++i) cin >> x >> y;
  sort(ind, ind + n, comp);
  for (int i = 0; i < n; ++i) {
    if (i & 1)
      C[ind[i]] = 1;
    else
      C[ind[i]] = 0;
  }
  for (int i = 0; i < n; ++i) {
    if (i == 0)
      cout << C[i];
    else
      cout << " " << C[i];
  }
  puts("");
}
