#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<pair<int, int> > v;
  vector<int> v2;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    v.push_back(make_pair(num, 0));
    v2.push_back(num);
  }
  for (int i = 0; i < m; i++) {
    int num1, num2;
    scanf("%d %d", &num1, &num2);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    v[i].second = i % 2;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (v[j].first == v2[i]) {
        if (i != (n - 1))
          printf("%d ", v[j].second);
        else
          printf("%d\n", v[j].second);
        break;
      }
  }
  return 0;
}
