#include <bits/stdc++.h>
using namespace std;
struct NODE {
  int x, id, val;
  NODE(int _x, int _id) : x(_x), id(_id) {}
};
vector<NODE> vec;
bool cmp1(const NODE& A, const NODE& B) { return A.x < B.x; }
bool cmp2(const NODE& A, const NODE& B) { return A.id < B.id; }
int main() {
  int n, m, a, b;
  vec.clear();
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a;
    vec.push_back(NODE(a, i));
  }
  sort(vec.begin(), vec.end(), cmp1);
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
  }
  for (int i = 0; i < n; i++) {
    vec[i].val = i % 2;
  }
  sort(vec.begin(), vec.end(), cmp2);
  for (int i = 0; i < n; i++) {
    cout << vec[i].val;
    if (i == n - 1)
      cout << endl;
    else
      cout << " ";
  }
  return 0;
}
