#include <bits/stdc++.h>
using namespace std;
int n, m;
pair<int, int> p[105];
void print() {
  cout << "!!!\n";
  for (int i = 1; i <= n; ++i) {
    cout << p[i].first << " " << p[i].second << endl;
  }
  cout << "!!!\n";
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= m; ++i) scanf("%*d%*d");
  for (int i = 1; i <= n; ++i) {
    p[i].first = i % 2;
    swap(p[i].first, p[i].second);
  }
  sort(p + 1, p + 1 + n);
  for (int i = 1; i <= n; ++i) {
    cout << p[i].second << " ";
  }
  cout << "\n";
  return 0;
}
