#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  bool color;
};
bool comp1(Point p1, Point p2) { return p1.x < p2.x; }
bool comp2(Point p1, Point p2) { return p1.y < p2.y; }
int n, m;
Point Points[111];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> Points[i].x;
    Points[i].y = i;
  }
  for (int i = 0; i < m; ++i) {
    bool found = false;
    int l, r;
    cin >> l >> r;
  }
  sort(Points, Points + n, comp1);
  for (int i = 0; i < n; ++i) {
    Points[i].color = i % 2;
  }
  sort(Points, Points + n, comp2);
  for (int i = 0; i < n; ++i) cout << Points[i].color << " ";
  cout << '\n';
}
