#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 123;
const long long INF = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
int n, m;
int col[111], l[111], r[111];
pair<int, int> x[111];
int res[111];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> x[i].first;
    x[i].second = i;
  }
  sort(x + 1, x + n + 1);
  for (int i = 1; i <= n; i++) {
    col[x[i].first] = i % 2;
  }
  for (int i = 1; i <= m; i++) {
    cin >> l[i] >> r[i];
  }
  for (int i = 1; i <= n; i++) {
    res[x[i].second] = col[x[i].first];
  }
  for (int i = 1; i <= n; i++) {
    cout << res[i] << " ";
  }
  return 0;
}
