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.util.*;
import java.io.*;
import java.math.*;
public class Main3
{
    static class Reader 
    { 
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} 
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];} 
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;} 
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();} 
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;} 
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;} 
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } 
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } 
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = i();}return ret;}
    }
    
    
 
           //       |----|       /\      |    |   -----   |
           //       |   /       /  \     |    |     |     |
           //       |--/       /----\    |----|     |     |
           //       |   \     /      \   |    |     |     |
           //       |    \   /        \  |    |   -----   -------

    static int arr[][]=new int[4][4];
    public static void clear()
    {
        ArrayList<Integer> rows=new ArrayList();
        ArrayList<Integer> columns=new ArrayList();
        for(int j=0;j<4;j++)
        {
            int f=0;
            for(int k=0;k<4;k++)
            {
                if(arr[j][k]==0)
                f=1;
            }
            if(f==0)
            rows.add(j);
        }
        for(int j=0;j<4;j++)
        {
            int f=0;
            for(int k=0;k<4;k++)
            {
                if(arr[k][j]==0)
                f=1;
            }
            if(f==0)
            columns.add(j);
        }
        for(int i:rows)
        for(int j=0;j<4;j++)
        arr[i][j]=0;
        for(int i:columns)
        for(int j=0;j<4;j++)
        arr[j][i]=0;
        /*for(int i=0;i<4;i++)
        {
            for(int j=0;j<4;j++)
            System.out.print(arr[i][j]+" ");
            System.out.println();
        }*/
    }
    public static void main(String[] args)throws IOException
    {
        PrintWriter out= new PrintWriter(System.out);
        Reader sc=new Reader();
        String s=sc.s();
        for(int i=0;i<s.length();i++)
        {
            if(s.charAt(i)=='1')
            {
                int f=0;
                for(int j=0;j<4;j++)
                {
                    for(int k=0;k<3;k++)
                    {
                        if(arr[j][k]==0&&arr[j][k+1]==0)
                        {
                            arr[j][k]=1;
                            arr[j][k+1]=1;
                            out.println(j+1+" "+(k+1));
                            f=1;
                            break;
                        }
                    }
                    if(f==1)
                    break;
                }
            }
            else
            {
                int f=0;
                for(int j=0;j<3;j++)
                {
                    for(int k=0;k<3;k++)
                    {
                        if(arr[k][j]==0&&arr[k+1][j]==0)
                        {
                            arr[k][j]=1;
                            arr[k+1][j]=1;
                            out.println(k+1+" "+(j+1));
                            f=1;
                            break;
                        }
                    }
                    if(f==1)
                    break;
                }
            }
            clear();
        }
        out.flush();
    }
}