#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
int main() {
  long long n, i, j, m;
  cin >> n >> m;
  long long t, p;
  vector<long long> v, u;
  for (i = 0; i < n; i++) {
    cin >> t;
    v.push_back(t);
    u.push_back(t);
  }
  sort(u.begin(), u.end());
  map<long long, long long> mp;
  for (i = 0; i < m; i++) cin >> t >> p;
  for (i = 0; i < n; i++) mp[u[i]] = (i % 2 ? 0 : 1);
  for (i = 0; i < n; i++) cout << mp[v[i]] << ' ';
  cout << endl;
}
