#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5, mod = (int)1e9 + 7;
int a[N] = {};
vector<int> v;
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  int n, m, mx = 0;
  cin >> n >> m;
  for (int i = 1; i <= (int)n; ++i) {
    int x;
    cin >> x;
    mx = max(mx, x);
    v.push_back(x);
    a[x] = 1;
  }
  int q = 0;
  for (int i = 1; i <= (int)mx; ++i) {
    if (a[i]) {
      a[i] = q;
      q ^= 1;
    }
  }
  for (auto u : v) cout << a[u] << " ";
  return 0;
}
