#include <bits/stdc++.h>
using namespace std;
const int prime = 999983;
const int INF = 0x7FFFFFFF;
const long long INFF = 0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const double inf = 1e18;
const double eps = 1e-6;
const long long mod = 1e9 + 7;
const int maxn = 1e5 + 7;
const int maxm = 4e6 + 7;
struct node {
  int id;
  int indx;
} arr[150];
bool cmp1(node a, node b) { return a.id < b.id; }
bool cmp2(node a, node b) { return a.indx < b.indx; }
int color[150];
int main() {
  int n, m, l, r, c = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i].id);
    arr[i].indx = i;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &l, &r);
  }
  sort(arr + 1, arr + n + 1, cmp1);
  for (int i = 1; i <= n; i++) {
    color[arr[i].indx] = c;
    c = c ^ 1;
  }
  sort(arr + 1, arr + n + 1, cmp2);
  for (int i = 1; i <= n; i++) {
    printf("%d ", color[arr[i].indx]);
  }
  return 0;
}
