Problem: Peter Parker wants to play a game with Dr. Octopus. The game is about cycles. Cycle is a sequence of vertices, such that first one is connected with the second, second is connected with third and so on, while the last one is connected with the first one again. Cycle may consist of a single isolated vertex.

Initially there are k cycles, i-th of them consisting of exactly vi vertices. Players play alternatively. Peter goes first. On each turn a player must choose a cycle with at least 2 vertices (for example, x vertices) among all available cycles and replace it by two cycles with p and x - p vertices where 1 ≤ p < x is chosen by the player. The player who cannot make a move loses the game (and his life!).

Peter wants to test some configurations of initial cycle sets before he actually plays with Dr. Octopus. Initially he has an empty set. In the i-th test he adds a cycle with ai vertices to the set (this is actually a multiset because it can contain two or more identical cycles). After each test, Peter wants to know that if the players begin the game with the current set of cycles, who wins? 

Peter is pretty good at math, but now he asks you to help.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of tests Peter is about to make.

The second line contains n space separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), i-th of them stands for the number of vertices in the cycle added before the i-th test.

Output

Print the result of all tests in order they are performed. Print 1 if the player who moves first wins or 2 otherwise.

Examples

Input

3
1 2 3


Output

2
1
1


Input

5
1 1 5 1 1


Output

2
2
2
2
2

Note

In the first sample test:

In Peter's first test, there's only one cycle with 1 vertex. First player cannot make a move and loses.

In his second test, there's one cycle with 1 vertex and one with 2. No one can make a move on the cycle with 1 vertex. First player can replace the second cycle with two cycles of 1 vertex and second player can't make any move and loses.

In his third test, cycles have 1, 2 and 3 vertices. Like last test, no one can make a move on the first cycle. First player can replace the third cycle with one cycle with size 1 and one with size 2. Now cycles have 1, 1, 2, 2 vertices. Second player's only move is to replace a cycle of size 2 with 2 cycles of size 1. And cycles are 1, 1, 1, 1, 2. First player replaces the last cycle with 2 cycles with size 1 and wins.

In the second sample test:

Having cycles of size 1 is like not having them (because no one can make a move on them). 

In Peter's third test: There a cycle of size 5 (others don't matter). First player has two options: replace it with cycles of sizes 1 and 4 or 2 and 3.

  * If he replaces it with cycles of sizes 1 and 4: Only second cycle matters. Second player will replace it with 2 cycles of sizes 2. First player's only option to replace one of them with two cycles of size 1. Second player does the same thing with the other cycle. First player can't make any move and loses. 
  * If he replaces it with cycles of sizes 2 and 3: Second player will replace the cycle of size 3 with two of sizes 1 and 2. Now only cycles with more than one vertex are two cycles of size 2. As shown in previous case, with 2 cycles of size 2 second player wins. 



So, either way first player loses.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MOD = int(1e9) + 7;
const double PI = acos(-1.0);
const double DELTA = 0.000000001;
const long long PINF = 1e18;
const long long NINF = -1e18;
inline long long in() {
  long long n = 0, s = 1;
  char p = getchar_unlocked();
  if (p == '-') s = -1;
  while ((p < '0' || p > '9') && p != EOF && p != '-') p = getchar_unlocked();
  if (p == '-') s = -1, p = getchar_unlocked();
  while (p >= '0' && p <= '9') {
    n = (n << 3) + (n << 1) + (p - '0');
    p = getchar_unlocked();
  }
  return n * s;
}
inline void ou(long long x) {
  int i = 20;
  char buf[21];
  buf[20] = ' ';
  do {
    buf[--i] = x % 10 + '0';
    x /= 10;
  } while (x);
  do {
    putchar(buf[i]);
  } while (buf[i++] != ' ');
}
inline void ouln(long long x) {
  int i = 20;
  char buf[21];
  buf[20] = '\n';
  do {
    buf[--i] = x % 10 + '0';
    x /= 10;
  } while (x);
  do {
    putchar(buf[i]);
  } while (buf[i++] != '\n');
}
inline long long fme(long long a, long long b, long long MOD) {
  long long res = 1;
  a %= MOD;
  while (b) {
    if (b % 2) {
      res *= a;
      res %= MOD;
    }
    a *= a;
    a %= MOD;
    b /= 2;
  }
  return res % MOD;
}
template <class T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
inline vector<vector<long long> > mul(vector<vector<long long> > &A,
                                      vector<vector<long long> > &B,
                                      long long m = MOD) {
  int n = A.size(), i, j, k;
  vector<vector<long long> > C(n, vector<long long>(n));
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      for (k = 0; k < n; k++) C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % m;
  return C;
}
inline vector<vector<long long> > pow(vector<vector<long long> > &A,
                                      long long x, long long m = MOD) {
  int n = A.size(), i;
  vector<vector<long long> > B(n, vector<long long>(n));
  for (i = 0; i < n; i++) B[i][i] = 1;
  while (x > 0) {
    if (x % 2) B = mul(B, A, m);
    x /= 2;
    A = mul(A, A, m);
  }
  return B;
}
inline bool isSub(std::string txt, std::string s) {
  int pos = -1;
  bool ok = true;
  for (int i = 0; ok && i != s.size(); i++) {
    ok = (pos = txt.find(s[i], pos + 1)) != string::npos;
  }
  return ok;
}
inline int countOne(long long n) {
  int count = 0;
  while (n) {
    n = n & (n - 1);
    count++;
  }
  return count;
}
inline std::string srev(std::string s) {
  std::string demo = "";
  for (int i = s.length() - 1; i >= 0; i--) demo += s[i];
  return demo;
}
inline std::string ts(long long i) {
  std::string s = "", nm = "0123456789";
  if (i == 0) {
    s = "0";
  }
  while (i) {
    s += nm[i % 10];
    i /= 10;
  }
  return srev(s);
}
inline std::string tb(long long i) {
  std::string ans = "";
  std::string arr = "01";
  while (i) {
    ans += arr[i % 2];
    i = i / 2;
  }
  return srev(ans);
}
long long arr[100010];
int main() {
  ios_base::sync_with_stdio(false);
  long long t = 1;
  while (t--) {
    long long n = 0, m = 0, k = 0, ans = 0, count = 0, cc = 0, ans1 = 0,
              test = 0, beg = 0, end = 0, mid = 0, pivot = 0, i = 0, j = 0,
              sum = 0, min = PINF, max = NINF;
    std::string s = "", s1 = "", s2 = "", s3 = "";
    double a = 0, b = 0;
    bool win1 = false, win2 = false;
    n = in();
    for (long long i = (0); i < (n); i++) arr[i] = in();
    if (arr[0] % 2 == 0) {
      win1 = true;
      ouln(1);
    } else {
      win2 = true;
      ouln(2);
    }
    for (long long i = (1); i < (n); i++) {
      if (win1 && arr[i] % 2 != 0) {
        ouln(1);
      } else if (win1 && arr[i] % 2 == 0) {
        win2 = true;
        win1 = false;
        ouln(2);
      } else if (win2 && arr[i] % 2 != 0) {
        ouln(2);
      } else if (win2 && arr[i] % 2 == 0) {
        win2 = false;
        win1 = true;
        ouln(1);
      }
    }
  }
}