#include <bits/stdc++.h>
using namespace std;
int cs = 1;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << "\t";
    return *this;
  }
} dbg;
template <class A, class B>
ostream& operator<<(ostream& o, const pair<A, B>& p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (__typeof((v).end()) it = (v).begin(); it != (v).end(); ++it)
    o << *it << ", ";
  return o << "]";
}
template <class T>
ostream& operator<<(ostream& o, const set<T>& v) {
  o << "[";
  for (__typeof((v).end()) it = (v).begin(); it != (v).end(); ++it)
    o << *it << ", ";
  return o << "]";
}
template <class T>
inline void MAX(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void MIN(T& a, T b) {
  if (a > b) a = b;
}
template <class T>
inline bool read(T& x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
long long toInt(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
string toString(long long number) {
  stringstream second;
  second << number;
  return second.str();
}
vector<string> Split(string s) {
  vector<string> ret;
  istringstream second(s);
  string token;
  while (second >> token) ret.push_back(token);
  return ret;
}
long long BigMod(long long b, long long p, long long m) {
  long long ret = 1;
  while (p) {
    if (p & 1) ret = (ret * b) % m;
    p >>= (1ll), b = (b * b) % m;
  }
  return ret;
}
string i2b(long long a) {
  string s;
  do {
    s += (a & 1) + '0', a >>= 1;
  } while (a);
  reverse(s.begin(), s.end());
  return s;
}
long long GCD(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
const int MX = 1e5 + 7;
const int INF = 1e8 + 7;
pair<int, int> a[MX];
int Ans[MX];
int main() {
  int n, m;
  cin >> n >> m;
  for (__typeof((n)-1) i = (0); i <= (n)-1; ++i) {
    a[i].first = ({
      int a;
      scanf("%d", &a);
      a;
    });
    a[i].second = i;
  }
  for (__typeof((m)-1) i = (0); i <= (m)-1; ++i) {
    int x = ({
      int a;
      scanf("%d", &a);
      a;
    }),
        y = ({
          int a;
          scanf("%d", &a);
          a;
        });
  }
  sort(a, a + n);
  for (__typeof((n)-1) i = (0); i <= (n)-1; ++i) Ans[a[i].second] = i % 2;
  for (__typeof((n)-1) i = (0); i <= (n)-1; ++i) cout << Ans[i] << " ";
}
