#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const long long N = 100010;
long long n, f[N], p[N], ans[N], len, a[N], S;
bitset<N> b[70];
inline void mian() {
  n = read();
  for (long long i = 1; i <= n; ++i) a[i] = read(), S ^= a[i];
  for (long long o = 1; o >= 0; --o) {
    for (long long i = 62; i >= 0; --i)
      if ((S >> i & 1) == (o ^ 1)) {
        b[++len][n + 1] = o;
        for (long long j = 1; j <= n; ++j)
          if (a[j] >> i & 1) b[len][j] = 1;
        for (long long j = 1; j <= len - 1; ++j)
          if (b[len][f[j]]) b[len] ^= b[j];
        for (long long j = 1; j <= n; ++j)
          if (b[len][j]) {
            f[len] = j;
            break;
          }
        if (!f[len]) {
          b[len--].reset();
          continue;
        }
        for (long long j = 1; j <= len - 1; ++j)
          if (b[j][f[len]]) b[j] ^= b[len];
      }
  }
  for (long long i = 1; i <= len; ++i) ans[f[i]] = b[i][n + 1];
  for (long long i = 1; i <= n; ++i) printf("%lld ", 2ll - ans[i]);
}
signed main() {
  long long qwq = 1;
  while (qwq--) mian();
  return 0;
}
