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:


// LM10: The next Ballon d'Or
import java.util.*;
import java.io.*;
import java.math.*;
public class Main
{
    static class FastReader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(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 next(){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(next()) ;}
        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 void scanIntArr(int [] arr){ for(int li=0;li<arr.length;++li){ arr[li]=i();}}
        public void scanLongArr(long [] arr){for (int i=0;i<arr.length;++i){arr[i]=l();}}
        public void shuffle(int [] arr){ for(int i=arr.length;i>0;--i) { int r=(int)(Math.random()*i); int temp=arr[i-1]; arr[i-1]=arr[r]; arr[r]=temp; } }
    }

    public static void main(String[] args)throws IOException {
        /*
inputCopy
010
outputCopy
1 1
1 2
1 4

0001010100000110010100101010100101101111110000000000101010011011111111110100010101010101000010101010
        */
        PrintWriter pw = new PrintWriter(System.out);
        FastReader fr = new FastReader();
        char [] str=fr.nextLine().toCharArray();

        int [][] arr=new int[4][4];

        for(int i=0;i<str.length;++i)
        {
            char c=str[i];
            if(c=='0')
            {
                int x=-1;
                int y=-1;
                for(int j2=0;j2<4;++j2)
                {
                    if(arr[0][j2]==0)
                    {
                        x=0;
                        y=j2;
                        break;
                    }
                }
                arr[0][y]=1;
                arr[1][y]=1;
                pw.println((x+1)+" "+(y+1));
                if(y==3)
                {
                    arr[0][0]=0;
                    arr[0][1]=0;
                    arr[0][2]=0;
                    arr[0][3]=0;
                    arr[1][0]=0;
                    arr[1][1]=0;
                    arr[1][2]=0;
                    arr[1][3]=0;
                }
            }
            else
            {
                int x=-1;
                int y=-1;
                for(int j2=0;j2<4;++j2)
                {
                    if(arr[2][j2]==0)
                    {
                        x=2;
                        y=j2;
                        break;
                    }
                }
                arr[x][y]=1;
                arr[x][y+1]=1;
                pw.println((x+1)+" "+(y+1));
                if(y==2)
                {
                    arr[2][0]=0;
                    arr[2][1]=0;
                    arr[2][2]=0;
                    arr[2][3]=0;
                }
            }
        }
        pw.flush();
        pw.close();
    }
}