Problem: You are given a 4x4 grid. You play a game — there is a sequence of tiles, each of them is either 2x1 or 1x2. Your task is to consequently place all tiles from the given sequence in the grid. When tile is placed, each cell which is located in fully occupied row or column is deleted (cells are deleted at the same time independently). You can place tile in the grid at any position, the only condition is that tiles (and tile parts) should not overlap. Your goal is to proceed all given figures and avoid crossing at any time.

Input

The only line contains a string s consisting of zeroes and ones (1 ≤ |s| ≤ 1000). Zero describes vertical tile, one describes horizontal tile.

Output

Output |s| lines — for each tile you should output two positive integers r,c, not exceeding 4, representing numbers of smallest row and column intersecting with it.

If there exist multiple solutions, print any of them.

Example

Input


010


Output


1 1
1 2
1 4

Note

Following image illustrates the example after placing all three tiles: 

<image> Then the first row is deleted:  <image>

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class c {
	
	public static class pos
	{
		int val;
		int row,col;
		pos(int row,int col)
		{
			this.row = row;
			this.col = col;
		}
	}
	public static long mod = 1000000007;
	public static void main(String[] args) {
		// TODO Auto-generated method stud
		
		FastReader s = new FastReader();
		pos[][] board = new pos[4][4];
		
		String str = s.next();
		for(int i=0;i<4;i++)
			for(int j=0;j<4;j++)
				board[i][j] = new pos(i,j);
		for(int i=0;i<str.length();i++)
		{
			pos p;
			if(str.charAt(i)=='0')
				p = vertical(board);
			else
				p = horizontal(board);
			
			if(str.charAt(i)=='0')
			{
				board[p.row][p.col].val = 1;
				board[p.row+1][p.col].val = 1;
				
			}
			
			else
			{
				board[p.row][p.col].val = 1;
				board[p.row][p.col+1].val = 1;
				
			}
			
			System.out.println((p.row+1)+" "+(p.col+1));
			free(board);
			
			
			//printBoard(board);
				
		}
		//System.out.println("AT LAST");
		//printBoard(board);
		
	}
	
	public static void printBoard(pos[][] board)
	{

		for(int i=0;i<4;i++)
			
		{	for(int j=0;j<4;j++)
				System.out.print(board[i][j].val+" ");
		
		    System.out.println();
		}
	}
	
	public static void free(pos[][] board)
	{
		ArrayList<Integer> row = new ArrayList<>();
		for(int i=0;i<4;i++)
		{
			boolean free = true;
			for(int j=0;j<4;j++)
			{	if(board[i][j].val==0)
				{
					free = false;
					break;
				}
			}
			
			if(free)
				row.add(i);
		}
		
		ArrayList<Integer> col = new ArrayList<>();
		for(int i=0;i<4;i++)
		{
			boolean free = true;
			for(int j=0;j<4;j++)
			{	if(board[j][i].val==0)
				{
					free = false;
					break;
				}
			}
			
			if(free)
				col.add(i);
		}
		
		for(int i=0;i<row.size();i++)
		{
			for(int j=0;j<4;j++)
			   board[row.get(i)][j].val = 0;
		}
		
		for(int i=0;i<col.size();i++)
		{
			for(int j=0;j<4;j++)
			   board[j][col.get(i)].val = 0;
		}
	}
	
	public static pos vertical(pos[][] board)
	{
		pos ans = null;
		int covered = 0;
		for(int i=0;i<3;i++)
		{
			for(int j=0;j<4;j++)
			{
				if(board[i][j].val==0&&board[i+1][j].val==0)
				{
					board[i][j].val=1;
					board[i+1][j].val=1;
					int count = 0;
					for(int k=0;k<4;k++)
					{
						if(board[k][j].val==1)
							count++;
					}
					
					if(count>covered)
					{	ans = board[i][j];
					    covered = count;
					}
					
					count = 0;
					for(int k=0;k<4;k++)
					{
						if(board[i][k].val==1)
							count++;
					}
					
					if(count>covered)
					{	ans = board[i][j];
					    covered = count;
					}
					
					board[i][j].val=0;
					board[i+1][j].val=0;
				}
			}
		}
		
		return ans;
	}
	

	
	public static pos horizontal(pos[][] board)
	{
		pos ans = null;
		int covered = 0;
		for(int i=0;i<4;i++)
		{
			for(int j=0;j<3;j++)
			{
				if(board[i][j].val==0&&board[i][j+1].val==0)
				{
					board[i][j].val=1;
					board[i][j+1].val=1;
					int count = 0;
					for(int k=0;k<4;k++)
					{
						if(board[i][k].val==1)
							count++;
					}
					
					if(count>covered)
					{	ans = board[i][j];
					    covered = count;
					}
					
					count = 0;
					for(int k=0;k<4;k++)
					{
						if(board[k][j].val==1)
							count++;
					}
					
					if(count>covered)
					{	ans = board[i][j];
					    covered = count;
					}
					board[i][j].val=0;
					board[i][j+1].val=0;
				}
			}
		}
		
		return ans;
	}
	
	public static long inverse(long r2, long r1)
	{
		long mod = r1;
		long t1 = 0, t2 = 1;
		
		while(r2 > 0)
		{
			long q = r1/r2;
			long r = r1%r2;
			r1 = r2;
			r2 = r;
			
			long t = t1 - q *t2;
			t1 = t2;
			t2 = t;
		}
		
		return (t1 + mod)%mod;
	}
	
	
	public static long lcm(long val1, long val2)
	{   val1 = val1%mod;
	    val2 = val2%mod;
		return ((val1 * val2)%mod *inverse(gcd(Math.max(val1, val2),Math.min(val1, val2)),mod))%mod;
	}
	
	public static long gcd(long val1, long val2)
	{
	    if(val2 == 0)
	    	return val1;
	    else
	    	return gcd(val2, val1%val2);
	}
	
		static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }


}