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 v_{i} 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 a_{i} 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 a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^9), 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.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
now = 2
for i in input().split():
    a = int(i)
    if a % 2 == 0:
        now = 3 - now
    print(now)


#!/usr/bin/env python3

try:
    while True:
        n = int(input())
        prev = 0
        for x in map(int, input().split()):
            prev = (prev + x - 1) & 0x1
            print("21"[prev])

except EOFError:
    pass


n = int(input())
ai = list(map(int,input().split()))
win = 2
for i in ai:
    if i % 2 == 0:
        win = 3 - win
    print(win)


n = int(input())

b = [0]*n
sum = 0
i = 0
for s in input().split():
    sum += int(s) - 1
    b[i] = sum
    i += 1
for i in range(n):
    print(2 - (b[i] % 2))



def main():
    n = int(input())
    items = input().split(" ")
    s = 0
    for p in items:
        s += int(p) + 1
        print(2 - (s & 1))



def __starting_point():
    main()
__starting_point()

n = int(input())
c = list(map(int, input().split()))
x = 0
y = 0
for v in c:
    if v != 1:
        x += v
        y += 1
    if x == 0:
        print(2)
    elif (x - y) % 2 == 0:
        print(2)
    else:
        print(1)


n = int(input())
a = list(map(int, input().split(" ")))

v = 0

for i in range(n):
	v += a[i]
	if (v - i)%2 == 0:
		print(1)
	else:
		print(2)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time


n       = int(input())
a       = [int(i) for i in input().split()]
steps   = 0
ans     = []
start = time.time()

for now in a:
    steps += now-1
    if steps%2 == 0:
        ans.append(2)
    else:
        ans.append(1)

for now in ans:
    print(now)
finish = time.time()
#print(finish - start)


a = int(input())
b = list(map(int, input().split()))
c = {2: 1, 1: 2}
d = 2
for i in range(a):
    if b[i] == 1:
        print(d)
    else:
        if b[i] % 2 == 0:
            print(c[d])
            d = c[d]
        else:
            print(d)


import sys
from decimal import *

def main():
    n = int(sys.stdin.readline())

    x = list(map(int, sys.stdin.readline().split()))
    
    ans = []
    cur = 0
    for i in x:
        cur += i-1
        if cur%2==0:
            ans.append("2")
        else:
            ans.append("1")
    
    print("\n".join(ans))
    

main()


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    a[i] -= 1
    a[i] = a[i] % 2
win = a[0] % 2
print(2 - win)
for i in range(1, n):
    if a[i]:
        win ^= 1
    print(2 - win)

n = int(input())
data = list(map(int, input().split()))
for i in range(n):
    data[i] -= 1
winner = data[0] % 2
print(2 - winner)
for i in range(1, n):
    if data[i] % 2 == 1:
        winner ^= 1
    print(2 - winner)

'''
a = [0] * 3000

def mex(l):
	for i in range(3000):
		if i not in l:
			return i
	return 3000

a[1] = 0
for i in range(2, 3000):
	a[i] = mex([a[x] ^ a[i - x] for x in range(1, i)])
'''
from itertools import accumulate

n = int(input())
a = list(map(int, input().split(' ')))
b = list(accumulate((~a[i] & 1 for i in range(n)), lambda i, j: i ^ j))

for i in b:
	print('2' if i == 0 else '1')


n = int(input())
l = list(map(int, input().split()))
last = 2
for i in l:
    if i == 1:
        print(last)
    else:
        if(i % 2 == 1):
            print(last)
        else:
            last = 2 if last == 1 else 1
            print(last)
    


def change(ans):
    if (ans == 1):
        ans = 2
    else:
        ans = 1
    return ans
n = int(input())
array = list(map(int, input().split()))
if array[0] % 2 != 0:
    ans = 2
else:
    ans = 1
print(ans)
for i in range(1,n):
    if (array[i] % 2 == 0):
        ans = change(ans)
    print(ans)

n=int(input())
l=list(input().split())
l=[int(i) for i in l]
winner=1
for i in l:
	if not i%2:
		winner=not winner
		print(int(winner)+1)
	else:
		print(int(winner)+1)



def main():
   n=int(input())
   t=list(map(int, input().split()))
   somme=0
   for i in range(len(t)):
      somme+=t[i]-1
      if somme%2==0:
         print(2)
      else:
         print(1)      
main()

n = int(input())
arr = list(map(int, input().split()))
win = 2 # who wins
turn = 1
for i in range(n):
    if arr[i] != 1:
        if arr[i] % 2 == 1:
            print(3 - turn)
        else:
            turn = 3 - turn
            print(3 - turn)            
    else:
        print(3 - turn)

n=int(input())
a = list(map(int,input().split()))
odd,even=0,0
for i in range(n):
	if((a[i] & 1) and a[i]>1):
		odd+=1
	elif(not(a[i] & 1) and a[i]>1):
		even+=1
	if((even & 1)):
		print("1")
	else:
		print("2")

n = int(input().strip())
cycles = list(map(int, input().strip().split()))

n_steps = 0
for c in cycles:
    n_steps += c - 1
    print(int(not(n_steps % 2)) + 1)


n = int(input())
a = list(map(int, input().split()))
answers = []
summa = 0
if a[0] == 1:
    answers.append(2)
else:
    if (a[0] - 1) % 2 == 0:
        answers.append(2)
    else:
        answers.append(1)
    summa += a[0] - 1
for i in range(1, n):
    v = a[i]
    if v == 1:
        answers.append(answers[-1])
        continue
    summa += v - 1
    if summa % 2 == 0:
        answers.append(2)
    else:
        answers.append(1)
for i in range(n):
    print(answers[i])


3

N = int(input())
K = list(map(int ,input().split()))

su = 0
for k in K:
    k -= 1
    su += k
    print(2 if su%2 == 0 else 1)



n= int( str(input()) )
inp = input().strip().split()
inp = [int(i) for i in inp]
cur=0
for val in inp:
    cur = (cur + (val-1)%2 )%2
    if(cur == 1):
        print(1)
    else:
        print(2)