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 JAVA):

Solution:
import java.util.*;
import java.math.*;
import java.io.*;
public class Luck{
	public static InputReader sc;
    public static PrintWriter out;
    public static final long MOD = (long)1e9 + 7L;
    public static void main(String[] args){
    	sc=new InputReader(System.in);	
    	out=new PrintWriter(System.out);
    	int n=sc.nextInt();
    	int prev=2;
    	for(int i=0;i<n;i++){
    		int a=sc.nextInt();
    		if(a%2==0){
    			if(prev==1){
    				prev=2;
    			}
    			else{
    				prev=1;
    			}
    			out.println(prev+" ");
    		}
    		else{
    			out.println(prev+" ");
    		}
    	}
    	out.close();
    }
    
    static void insert(Node root,int item){
    	if(root==null){
    		return;
    	}
    	if(item<=root.data){
    		if(root.left==null){
    			root.left=new Node(item);
    		}
    		else{
    			insert(root.left,item);
    		}
    	}
    	else{
    		if(root.right==null){
    			root.right=new Node(item);
    		}
    		else{
    			insert(root.right,item);
    		}
    	}
    }
    static class Node{
    	int data;
    	Node left;
    	Node right;
    	Node(int data){
    		this.data=data;
    		left=null;
    		right=null;
    	}
    }
//    static class Pair{
//    	String x;
//    	int y;
//    	Pair(){
//    		this.x="";
//    		this.y=-1;
//    	}
//    	Pair(String profit,int val,int count){
//    		this.x=profit;
//    		this.y=val;
//    	}
//    	public static Comparator<Pair> Val=new Comparator<Pair>(){
//    		public int compare(Pair p1,Pair p2){
//    			if(p1.x==p2.y){
//    				return p1.y-p2.y;
//    			}
//    			return (int)p1.x-(int)p2.x;
//    		}
//    	};
//    	public int hashCode() {
//    		final int prime = 31;
//    		int result = 1;
//    		result = prime * result + x;
//    		result = prime * result + x;
//    		return result;
//    	}
//    	public boolean equals(Object obj){
//    		if (this == obj)
//    	        return true;
//    	    if (!(obj instanceof Pair)) {
//    	        return false;
//    	    }
//    	 
//    	    Pair p = (Pair) obj;
//    	    if(p.x!=this.x){
//    	    	return false;
//    	    }
//    	    else if(p.y!=p.y){
//    	    	return false;
//    	    }
//    	    return true;
//    	}
//    }
    static class DisjointSet{
    	int n;
    	int[] par;
    	int[] rank;
    	DisjointSet(int n){
    		this.n=n;
    		this.par=new int[n];
    		this.rank=new int[n];
    		makeSet();
    	}
    	void makeSet(){
    		for(int i=0;i<n;i++){
    			par[i]=i;
    			rank[i]=1;
    		}
    	}
    	void union(int x,int y){
    		int parX=parent(x);
    		int parY=parent(y);
    		if(parX!=parY){
    			if(rank[parX]>=rank[parY]){
    				rank[parX]+=rank[parY];
    				rank[parY]=0;
    				par[parY]=parX;
    			}
    			else{
    				rank[parY]+=rank[parX];
    				rank[parX]=0;
    				par[parX]=parY;
    			}
    		}
    	}
    	int parent(int c){
    		int i=c;
    		while(i!=par[i]){
    			i=par[i];
    		}
    		return i;
    	}
    }
    static int gcd(int a,int b){
    	if(b==0){
    		return a;
    	}
    	return gcd(b,a%b);
    	
    }
    static int lcm(int a,int b){
    	int g;
    	if(a<b){
    		g=gcd(b,a);
    	}
    	else{
    		g=gcd(a,b);
    	}
    	return (a*b)/g;
    }
    
    static boolean isPrime(int n){
    	 if (n == 2)
    	        return true;
    	    for (long i = 2; i * i <= n; i++) {
    	        if (n % i == 0)
    	            return false;
    	    }
    	    return true;
    }
    
    static void shuffle(int[] A){
    	for(int i=A.length-1;i>0;i--){
    		int j=(int)(Math.random()*(i+1));
    		int temp=A[j];
    		A[j]=A[i];
    		A[i]=temp;
    	}
    }
    
//	public static class Node implements Comparable<Node>{
//	    int u;
//	    int v;
//	    public Node(){
//	    	;
//	    }
//	    public Node (int u, int v) {
//	    	this.u = u;
//	        this.v = v;
//	    }
//	    
//	    public void print() {
//	        out.println(v + " " + u + " ");
//	    }
//	   
//	    public int compareTo(Node n1){
//	    	return this.u-n1.u;
//	    }
//	}
	public static long power(long base,long exp,long mod){
		if(exp==0){
			return 1;
		}
		if(exp==1){
			return base;
		}
		long temp=exp/2;
		long val=power(base,temp,mod);
		long result=val*val;
		result=(result%mod);
		long AND=exp&1;
		if(AND==1){
			result*=base;
			result=(result%mod);
		}
		return result;
	}
	public static BigInteger pow(BigInteger base, BigInteger exp) {
	    if(exp.equals(new BigInteger(String.valueOf(0)))){
	        return new BigInteger(String.valueOf(1));
	    }    
	    if(exp.equals(new BigInteger(String.valueOf(1))))
	        return base;
	    BigInteger temp=exp.divide(new BigInteger(String.valueOf(2)));
	    BigInteger val = pow(base, temp);
	    BigInteger result = val.multiply(val);
	    result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    BigInteger AND=exp.and(new BigInteger(String.valueOf(1)));
	    if(AND.equals(new BigInteger(String.valueOf(1)))){
	        result = result.multiply(base);
	        result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    }    
	    return result;
	}
	    
	static class InputReader {

	    private InputStream stream;
	    private byte[] buf = new byte[8192];
	    private int curChar, snumChars;
	    private SpaceCharFilter filter;

	    public InputReader(InputStream stream) {
	        this.stream = stream;
	    }

	    public int snext() {
	        if (snumChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= snumChars) {
	            curChar = 0;
	            try {
	                snumChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	            if (snumChars <= 0)
	                return -1;
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        int res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        long res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public String readString() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    public boolean isSpaceChar(int c) {
	        if (filter != null)
	            return filter.isSpaceChar(c);
	        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }

	    public interface SpaceCharFilter {
	        public boolean isSpaceChar(int ch);
	    }
	}

}