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.lang.*;
import java.math.*;
import java.io.*;

/* abhi2601 */

public class Q1 implements Runnable{

    final static long mod = (long)1e9 + 7;

    public void run() {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        String s=sc.next();
        int c=0;
        StringBuilder sb=new StringBuilder();
        int a[][]=new int[4][4];
        for(int i=0;i<s.length();i++){
            int q1=-1,q2=-1;
            for(int j=0;j<4;j++){
                if(s.charAt(i)=='1'){
                    if(a[j][0]==0 && a[j][1]==0){
                        if(a[j][2]==1 && a[j][3]==1){
                            q1=j;
                            q2=0;
                            break;
                        }
                        if(q1==-1 && q2==-1){
                            q1=j;
                            q2=0;
                        }
                    }
                    else if(a[j][1]==0 && a[j][2]==0){
                        if(a[j][0]==1 && a[j][3]==1){
                            q1=j;
                            q2=1;
                            break;
                        }
                        if(q1==-1 && q2==-1){
                            q1=j;
                            q2=1;
                        }
                    }
                    else if(a[j][2]==0 && a[j][3]==0){
                        if(a[j][0]==1 && a[j][1]==1){
                            q1=j;
                            q2=2;
                            break;
                        }
                        if(q1==-1 && q2==-1){
                            q1=j;
                            q2=2;
                        }
                    }
                }
                else{
                    if(a[0][j]==0 && a[1][j]==0){
                        if(a[2][j]==1 && a[3][j]==1){
                            q1=0;
                            q2=j;
                            break;
                        }
                        if(q1==-1 && q2==-1){
                            q1=0;
                            q2=j;
                        }
                    }
                    else if(a[1][j]==0 && a[2][j]==0){
                        if(a[0][j]==1 && a[3][j]==1){
                            q1=1;
                            q2=j;
                            break;
                        }
                        if(q1==-1 && q2==-1){
                            q1=1;
                            q2=j;
                        }
                    }
                    else if(a[2][j]==0 && a[3][j]==0){
                        if(a[0][j]==1 && a[1][j]==1){
                            q1=2;
                            q2=j;
                            break;
                        }
                        if(q1==-1 && q2==-1){
                            q1=2;
                            q2=j;
                        }
                    }
                }
            }
            if(s.charAt(i)=='1'){
                a[q1][q2]=1;
                a[q1][q2+1]=1;
            }
            else{
                a[q1][q2]=1;
                a[q1+1][q2]=1;
            }
            w.println((q1+1)+" "+(q2+1));
            for(int j=0;j<4;j++){
                int c1=0;
                for(int k=0;k<4;k++){
                    if(a[j][k]==1) c1++;
                }
                int c2=0;
                for(int k=0;k<4;k++){
                    if(a[k][j]==1) c2++;
                }
                if(c1==4){
                    for(int k=0;k<4;k++){
                        a[j][k]=0;
                    }
                }
                if(c2==4){
                    for(int k=0;k<4;k++){
                        a[k][j]=0;
                    }
                }
            }
            /*for(int j=0;j<4;j++){
                for(int k=0;k<4;k++){
                    w.print(a[j][k]+" ");
                }
                w.println();
            }*/
        }
        w.close();
    }
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

        public int read()
        {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine()
        {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt()
        {
            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 long nextLong()
        {
            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 double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.')
            {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString()
        {
            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 boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

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

    public static void main(String args[]) throws Exception
    {
        new Thread(null, new Q1(),"q1",1<<26).start();
    }
}