#include <bits/stdc++.h>
using namespace std;
void enter() {
  int n, m;
  int a[10000], index[10000];
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    index[i] = i;
  }
  for (int i = 1; i <= n - 1; i++)
    for (int j = i + 1; j <= n; j++) {
      if (a[i] > a[j]) {
        swap(a[i], a[j]);
        swap(index[i], index[j]);
      }
    }
  int i = 1;
  while (i <= n) {
    for (int j = 1; j <= n; j++)
      if (index[j] == i) {
        cout << j % 2 << " ";
        i++;
      }
  }
}
int main() {
  enter();
  return 0;
}
