#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int a, b;
  pair<int, int> num[109];
  bool s[109];
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> num[i].first;
    num[i].second = i;
  }
  sort(num, num + n);
  for (int i = 0; i < m; ++i) cin >> a >> b;
  for (int i = 0; i < n; ++i) s[num[i].second] = i % 2;
  for (int i = 0; i < n; ++i) cout << s[i] << " ";
  cout << endl;
  return 0;
}
