#include <bits/stdc++.h>
using namespace std;
bool rjes[100];
int n, m;
pair<int, int> koors[101];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    koors[i] = make_pair(a, i);
  }
  for (int i = 0; i < m; i++) {
    int a;
    int b;
    scanf("%d %d", &a, &b);
  }
  sort(koors, koors + n);
  bool help = 1;
  for (int i = 0; i < n; i++) {
    rjes[koors[i].second] = help;
    help = !help;
  }
  for (int i = 0; i < n; i++) printf("%d ", rjes[i]);
  return 0;
}
