#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  vector<pair<int, int> > X;
  cin >> N >> M;
  for (int i = 0; i < N; ++i) {
    int v;
    cin >> v;
    X.push_back(make_pair(v, i));
  }
  for (int i = 0; i < M; ++i) {
    int a, b;
    cin >> a >> b;
  }
  int res[100];
  sort(X.begin(), X.end());
  for (int i = 0; i < N; ++i) {
    res[X[i].second] = i % 2;
  }
  for (int i = 0; i < N; ++i) cout << res[i] << " ";
  return 0;
}
