#include <bits/stdc++.h>
int coords[101] = {0};
int result[101] = {0};
int main(void) {
  int counter = 0;
  int i, j, k;
  int n, m;
  int minInd = 0;
  scanf("%i %i", &n, &m);
  for (i = 0; i < n; ++i) scanf("%i", coords + i);
  for (i = 0; i < m; ++i) scanf("%i %i", &j, &k);
  for (i = 0; i < n; ++i) {
    minInd = i;
    for (j = 0; j < n; ++j) {
      if (coords[j] < coords[minInd]) minInd = j;
    }
    result[minInd] = counter;
    coords[minInd] = 100000;
    if (counter == 0)
      counter = 1;
    else
      counter = 0;
  }
  for (i = 0; i < n; ++i) printf("%i ", result[i]);
  return 0;
}
