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.io.*;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
	
	
	 public class Palindrome {
	
		static double eps=(double)1e-6;
		static long mod=(int)1e9+7;
		public static void main(String args[]){
			InputReader in = new InputReader(System.in);
			OutputStream outputStream = System.out;
			PrintWriter out = new PrintWriter(outputStream);
			Scanner sc=new Scanner(System.in);
			//----------My Code----------
			int n=in.nextInt();
			int a[]=new int[n];
			for(int i=0;i<n;i++)
				a[i]=in.nextInt();
			int ans=1;
			for(int i=0;i<n;i++){
				if(a[i]%2==0)
				{
					if(ans==1){
						ans=2;
						System.out.println(1);
					}
					else{
						ans=1;
						System.out.println(2);
					}
				}
				else
				{
					
					if(ans==1){
						ans=1;
						System.out.println(2);
					}
					else
					{
						ans=2;
						System.out.println(1);
					}
					
				}
				
			}
			
			
			//---------------The End------------------
			out.close();
		}
		private static void permutation(String prefix, String str,HashSet<String> hs) {
		    int n = str.length();
		    if (n == 0) hs.add(prefix);
		    else {
		        for (int i = 0; i < n; i++)
		            permutation(prefix + str.charAt(i), str.substring(0, i) + str.substring(i+1, n),hs);
		    }
		}
		static int[][] floydWarshall(int graph[][],int V)
	    {
	        int dist[][] = new int[V][V];
	        int i, j, k;
	 
	        /* Initialize the solution matrix same as input graph matrix.
	           Or we can say the initial values of shortest distances
	           are based on shortest paths considering no intermediate
	           vertex. */
	        for (i = 0; i < V; i++)
	            for (j = 0; j < V; j++)
	                dist[i][j] = graph[i][j];
	 
	        /* Add all vertices one by one to the set of intermediate
	           vertices.
	          ---> Before start of a iteration, we have shortest
	               distances between all pairs of vertices such that
	               the shortest distances consider only the vertices in
	               set {0, 1, 2, .. k-1} as intermediate vertices.
	          ----> After the end of a iteration, vertex no. k is added
	                to the set of intermediate vertices and the set
	                becomes {0, 1, 2, .. k} */
	        for (k = 0; k < V; k++)
	        {
	            // Pick all vertices as source one by one
	            for (i = 0; i < V; i++)
	            {
	                // Pick all vertices as destination for the
	                // above picked source
	                for (j = 0; j < V; j++)
	                {
	                    // If vertex k is on the shortest path from
	                    // i to j, then update the value of dist[i][j]
	                    if (dist[i][k] + dist[k][j] < dist[i][j])
	                        dist[i][j] = dist[i][k] + dist[k][j];
	                }
	            }
	        }
	return dist;
	    }
		static int recursiveBinarySearch(int[] sortedArray, int start, int end, int key) {
	
			if (start <= end) {
				int mid = start + (end - start) / 2; 
				if (key < sortedArray[mid]) {
					return recursiveBinarySearch(sortedArray, start, mid-1, key);
	
				} else if (key > sortedArray[mid]) {
					return recursiveBinarySearch(sortedArray, mid+1, end , key);
	
				} else {
					return mid;  
				}
			}
			return -(start + 1); 
		}
	
		static long modulo(long a,long b,long c) {
			long x=1;
			long y=a;
			while(b > 0){
				if(b%2 == 1){
					x=(x*y)%c;
				}
			
				y = (y*y)%c; // squaring the base
				b /= 2;
			}
			return  x%c;
		}
		
		
		static long gcd(long x, long y)
		
		{
			long r=0, a, b;
			a = (x > y) ? x : y; // a is greater number
			b = (x < y) ? x : y; // b is smaller number
			r = b;
			while(a % b != 0)
			{
				r = a % b;
				a = b;
				b = r;
			}
			return r;
		}
		static class pair implements Comparable<pair> {
			int x;
			int y;
			//int i;
			pair(int  xx,int yy){
				
				x=xx;
				y=yy;
				//i=ii;
			}
			@Override
			public int compareTo(pair arg0) {
				return Long.compare(this.x, arg0.x);
			}
		
		}
		static class InputReader {
			public BufferedReader reader;
			public StringTokenizer tokenizer;
	
			public InputReader(InputStream inputstream) {
				reader = new BufferedReader(new InputStreamReader(inputstream));
				tokenizer = null;
			}
	
			public String nextLine(){
				String fullLine=null;
				while (tokenizer == null || !tokenizer.hasMoreTokens()) {
					try {
						fullLine=reader.readLine();
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
					return fullLine;
				}
				return fullLine;
			}
			public String next() {
				while (tokenizer == null || !tokenizer.hasMoreTokens()) {
					try {
						tokenizer = new StringTokenizer(reader.readLine());
					} catch (IOException e) {
						throw new RuntimeException(e);
					}
				}
				return tokenizer.nextToken();
			}
			public long nextLong() {
				return Long.parseLong(next());
			}
			public int nextInt() {
				return Integer.parseInt(next());
			}
		}
	}