#include <bits/stdc++.h>
using namespace std;
bool isRed[105];
int main() {
  int i, n, m, x, j, l, r, a[2];
  vector<pair<int, int> > segs, points;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> x, points.push_back(pair<int, int>(x, i));
  sort((points).begin(), (points).end());
  for (i = 0; i < n; i++) isRed[points[i].second] = (i % 2);
  for (i = 0; i < n; i++) printf("%d ", isRed[i]);
  return 0;
}
