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.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.util.*;


public class Soly
{
    static final int INF = Integer.MAX_VALUE;

    static void mergeSort(int[] a,int [] c, int b, int e)
    {
        if(b < e)
        {
            int q = (b + e) >>1;
            mergeSort(a,c, b, q);
            mergeSort(a, c,q + 1, e);
            merge(a,c, b, q, e);
        }
    }


    static void merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
            }
    }
    static  ArrayList<Integer>ss,hh;
static int bs(int n){
    int s=0,e=hh.size()-1,mid=0,ans=-1;
    while (s<=e){
        mid=(e+s)>>1;
        if (hh.get(mid)>=n){
            ans=mid;
            e=mid-1;
        }else s=mid+1;
    }
    return ans;
}


    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        try (PrintWriter or = new PrintWriter(System.out)) {
            char[] a= in.next().toCharArray();
            boolean[] [] grid= new boolean[4][4];
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j <4 ; j++) {
                    boolean e=true;
                    for (int k = 0; k <4 ; k++) {
                        e=(e&grid[j][k]);
                    }
                    
                    if (e){
                        for (int k = 0; k < 4; k++) {
                            grid[j][k]=false;
                        }
                    }
                }
                for (int j = 0; j <4 ; j++) {
                    boolean e=true;
                    for (int k = 0; k <4 ; k++) {
                        e=(e&grid[k][j]);
                    }
                    if (e){
                        for (int k = 0; k < 4; k++) {
                            grid[k][j]=false;
                        }
                    }
                }
                if (a[i]=='0'){
                    boolean e=false;
                    for (int l = 0; l < 4; l++) {
                        if (e)break;
                        for (int m = 0; m < 4; m++) {
                            if ((m+1<4)&&!grid[m][l]&&!grid[m+1][l]){
                                or.println((m+1)+" "+(l+1));
                                grid[m][l]=true;
                                grid[m+1][l]=true;
                                e=true;
                                break;
                            }
                        }

                    }
                }
                else{
                    boolean e=false;
                    for (int l = 0; l < 4; l++) {
                        if (e)break;
                        for (int m = 0; m < 4; m++) {
                            if ((m+1<4)&&!grid[l][m]&&!grid[l][m+1]){
                                or.println((l+1)+" "+(m+1));
                                grid[l][m]=true;
                                grid[l][m+1]=true;
                                e=true;
                                break;
                            }
                        }

                    }
                }
            }

        }
    }











    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }



}
class coooo implements Comparable<coooo> {
    String st;
    int s,h;

    public coooo(String f,int s, int h) {
        this.st=f;
        this.s = s;
        this.h = h;
        //this.ind = ind;
    }

    @Override
    public int compareTo(coooo o) {
       return Long.compare(1l*o.s*h,1l*s*o.h);
    }
}