#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 10;
int n, m, ans[MAXN];
pair<int, int> p[MAXN];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    p[i] = pair<int, int>(x, i);
  }
  sort(p, p + n);
  for (int i = 0; i < n; ++i) ans[p[i].second] = i % 2;
  for (int i = 0; i < n; ++i) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
