#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n;
  cin >> d;
  int a[n];
  int b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    if ((search_n(b, b + n, 1, a[i]) - b) % 2 == 0)
      cout << 1 << " ";
    else
      cout << 0 << " ";
  }
}
