#include <bits/stdc++.h>
using namespace std;
int n, m, tem;
map<int, int>::iterator l_it;
map<int, int> mas;
vector<int> poi;
int pp[110];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &tem);
    mas[tem] = i;
    poi.push_back(tem);
  }
  int in = 0;
  for (l_it = mas.begin(); l_it != mas.end(); l_it++) {
    pp[l_it->first] = (in++) % 2;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", pp[poi.at(i)]);
  }
}
