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.*;
import java.math.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;

public class Solution 
{
    static class InputReader 
    {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

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

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                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 {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        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 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 boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
    static long modInverse(long a,long m) 
    { 
        long m0 = m; 
        long y = 0, x = 1; 
  
        if (m == 1) 
            return 0; 
  
        while (a > 1) 
        { 
            long q = a / m; 
            long t = m; 
            m = a % m; 
            a = t; 
            t = y; 
            y = x - q * y; 
            x = t; 
        } 
  
        if (x < 0) 
            x += m0; 
  
        return x; 
    }
    public static long power(long a,long b,long mod)
    {
        if(b==0)
            return 1;
        else if(b==1)
            return a;
        else
        {
            if(b%2==1)
            {
                long p=power(a,b/2,mod);
                return((p*p*a)%mod);
            }
            else
            {
                long p1=power(a,b/2,mod);
                return((p1*p1)%mod);
            }
        }
    }
    static class node
    {
        int v;
        ArrayList<node> ar;
        node(int a1)
        {
            v=a1;
            ar=new ArrayList<node>();
        }
    }
    public static long mod=998244353;
    public static void main(String[] args) throws IOException 
    {
        InputReader in=new InputReader(System.in);
        PrintWriter w=new PrintWriter(System.out);
        //int n=in.nextInt();
        String s=in.readString();
        int n=s.length();
        boolean[] h=new boolean[2];
        boolean[] v=new boolean[4];
        int[] rh=new int[2];
        int[] ch=new int[2];
        int[] rv=new int[4];
        int[] cv=new int[4];
        int[] a1=new int[n];
        int[] a2=new int[n];
        int vc=0,hc=0;
        for(int i=0;i<4;i++)
        {
            rv[i]=1;
            cv[i]=i+1;
        }
        rh[0]=4;
        rh[1]=4;
        ch[0]=1;
        ch[1]=3;
        for(int i=0;i<n;i++)
        {
            if(s.charAt(i)=='0')
            {
                //v
                for(int j=0;j<4;j++)
                {
                    if(!v[j])
                    {
                        v[j]=true;
                        a1[i]=rv[vc%4];
                        a2[i]=cv[vc%4];
                        vc++;
                        if(vc%4==0)
                        {
                            Arrays.fill(v,false);
                            vc=0;
                        }
                        break;
                    }
                }
            }
            else
            {
                for(int j=0;j<2;j++)
                {
                    if(!h[j])
                    {
                        h[j]=true;
                        a1[i]=rh[hc%2];
                        a2[i]=ch[hc%2];
                        hc++;
                        break;
                    }
                    if(hc%2==0)
                    {
                        Arrays.fill(h,false);
                        hc=0;
                    }
                    
                }
            }
            w.println(a1[i]+" "+a2[i]);
        }

        w.close();
    }
}