#include <bits/stdc++.h>
using namespace std;
int gcd(int u, int v) { return (v != 0) ? gcd(v, u % v) : u; }
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> points(n), vec(n);
  for (int i = 0; i < n; i++) cin >> points[i].first;
  vec = points;
  vector<pair<int, int>> seg(m);
  for (int i = 0; i < m; i++) cin >> seg[i].first >> seg[i].second;
  sort(points.begin(), points.end());
  for (int i = 0; i < n; i++) points[i].second = i % 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (points[j].first == vec[i].first) cout << points[j].second << " ";
  }
  cout << endl;
}
