#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
int n, m;
pair<int, int> pos[105];
int ans[105];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (n); ++i) {
    int a;
    cin >> a;
    pos[i] = make_pair(a, i);
  }
  sort(pos, pos + n);
  for (int i = 0; i < (n); ++i) ans[pos[i].second] = i % 2;
  for (int i = 0; i < (n); ++i) printf("%d%c", ans[i], i == n - 1 ? '\n' : ' ');
  return 0;
}
