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.util.*;
import static java.lang.Math.*;

public class Main {
    private static boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private static Reader in;
    private static PrintWriter out;
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    private static int min(int... a){int min=a[0]; for(int i:a) min=Math.min(min, i); return min;}
    private static int max(int... a){int max=a[0]; for(int i:a) max=Math.max(max, i); return max;}
    private static long min(long... a){long min=a[0]; for(long i:a)min=Math.min(min, i); return min;}
    private static long max(long... a){long max=a[0]; for(long i:a)max=Math.max(max, i); return max;}
    private static String strm(String str, long m) {
        String ans="";
        while(m>0) {
            if(m%2==1) ans=ans.concat(str);
            str=str.concat(str); m>>=1;
        } return ans;
    }
    private static long mod(long a, long mod) {long res = a%mod; return res>=0 ? res : res+mod;}
    private static int mod(int a, int mod) {int res = a%mod; return res>=0 ? res : res+mod;}
    private static long modpow(long x, int n, int mod) {
        long res = 1;
        for (long p = x; n > 0; n >>= 1, p = mod((mod(p, mod)*mod(p, mod)),  mod)) {
            if ((n & 1) != 0) res = mod(mod(res, mod) * mod(p, mod), mod);
        }
        return res;
    }
    private static long gcd(long a, long b) {return b == 0 ? Math.abs(a) : gcd(b, a % b);}
    private static int gcd(int a, int b) {return b == 0 ? Math.abs(a) : gcd(b, a % b);}
    private static long gcd(long... a) {long gcd=a[0]; for(long x:a) gcd=gcd(gcd, x); return gcd;}
    private static int gcd(int... a) {int gcd=a[0]; for(int x:a) gcd=gcd(gcd, x); return gcd;}
    private static long lcm(long a, long b) {return Math.abs(a / gcd(a, b) * b);}
    private static class Pair {
        public int x, y;
        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
        @Override
        public boolean equals(Object obj) {
            if (obj == this) return true;
            if (!(obj instanceof Pair)) return false;
            Pair pair = (Pair)obj;
            return this.x == pair.x && this.y == pair.y;
        }

        @Override
        public int hashCode() {
            return (this.x+" "+this.y).hashCode();
        }
    }
    private static class Triplet {
        public int x, y, z;
        public Triplet(int x, int y, int z) {
            this.x = x;
            this.y = y;
            this.z = z;
        }
        @Override
        public boolean equals(Object obj) {
            if (obj == this) return true;
            if (!(obj instanceof Triplet)) return false;
            Triplet triplet = (Triplet)obj;
            return this.x == triplet.x && this.y == triplet.y && this.z == triplet.z;
        }

        @Override
        public int hashCode() {
            return (this.x+" "+this.y+" "+this.z).hashCode();
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    static class Reader {
        private BufferedReader br;
        private StringTokenizer token;
        protected Reader(FileReader obj) {
            br = new BufferedReader(obj, 32768);
            token = null;
        }
        protected Reader() {
            br = new BufferedReader(new InputStreamReader(System.in), 32768);
            token = null;
        }
        protected String next() {
            while(token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (Exception e) {e.printStackTrace();}
            } return token.nextToken();
        }
        protected String nextLine() {
            String str="";
            try {
                str = br.readLine();
            } catch (Exception e) {e.printStackTrace();}
            return str;
        }
        protected int nextInt() {return Integer.parseInt(next());}
        protected long nextLong() {return Long.parseLong(next());}
        protected double nextDouble() {return Double.parseDouble(next());}
        protected long[] nextLongArr(int n) {
            long[] arr = new long[n]; for(int i=0; i<n; i++) arr[i] = nextLong(); return arr;
        }
        protected int[] nextIntArr(int n) {
            int[] arr = new int[n]; for(int i=0; i<n; i++) arr[i] = nextInt(); return arr;
        }
    }
    public static final int mod = 1_000_000_007;
    static char[][] grid = new char[5][5];
    private static int checkv(int x, int y) {
        int ans = 0;
        if (grid[1][y] == '#' && grid[2][y] == '#' && grid[3][y] == '#' && grid[4][y] == '#') ans++;
        if (grid[x][1] == '#' && grid[x][2] == '#' && grid[x][3] == '#' && grid[x][4] == '#') ans++;
        if (grid[x+1][1] == '#' && grid[x+1][2] == '#' && grid[x+1][3] == '#' && grid[x+1][4] == '#') ans++;
        return ans;
    }
    private static void checkdelv(int x, int y) {
        if (grid[1][y] == '#' && grid[2][y] == '#' && grid[3][y] == '#' && grid[4][y] == '#') {
            grid[1][y] = '.'; grid[2][y] = '.'; grid[3][y] = '.'; grid[4][y] = '.';}
        if (grid[x][1] == '#' && grid[x][2] == '#' && grid[x][3] == '#' && grid[x][4] == '#') {
            grid[x][1] = '.'; grid[x][2] = '.'; grid[x][3] = '.'; grid[x][4] = '.';}
        if (grid[x+1][1] == '#' && grid[x+1][2] == '#' && grid[x+1][3] == '#' && grid[x+1][4] == '#') {
            grid[x+1][1] = '.'; grid[x+1][2] = '.'; grid[x+1][3] = '.'; grid[x+1][4] = '.';}
    }
    private static int checkh(int x, int y) {
        int ans = 0;
        if (grid[1][y] == '#' && grid[2][y] == '#' && grid[3][y] == '#' && grid[4][y] == '#') ans++;
        if (grid[1][y+1] == '#' && grid[2][y+1] == '#' && grid[3][y+1] == '#' && grid[4][y+1] == '#') ans++;
        if (grid[x][1] == '#' && grid[x][2] == '#' && grid[x][3] == '#' && grid[x][4] == '#') ans++;
        return ans;
    }
    private static void checkdelh(int x, int y) {
        if (grid[1][y] == '#' && grid[2][y] == '#' && grid[3][y] == '#' && grid[4][y] == '#') {
            grid[1][y] = '.'; grid[2][y] = '.'; grid[3][y] = '.'; grid[4][y] = '.';}
        if (grid[1][y+1] == '#' && grid[2][y+1] == '#' && grid[3][y+1] == '#' && grid[4][y+1] == '#') {
            grid[1][y+1] = '.'; grid[2][y+1] = '.'; grid[3][y+1] = '.'; grid[4][y+1] = '.';}
        if (grid[x][1] == '#' && grid[x][2] == '#' && grid[x][3] == '#' && grid[x][4] == '#') {
            grid[x][1] = '.'; grid[x][2] = '.'; grid[x][3] = '.'; grid[x][4] = '.';}
    }
    private static void solve() throws Exception {
        char[] arr = in.nextLine().toCharArray();
        int n = arr.length;
        int[][] ans = new int[n][2];
        for (int i=0; i<=4; i++) {
            for (int j=0; j<=4; j++) grid[i][j] = '.';
        }
        for (int t=0; t<n; t++) {
            char bar = arr[t];
            if (bar == '0') {
                int max = -1, indi = -1, indj = -1;
                for (int i=1; i<=3; i++) {
                    for (int j=1; j<=4; j++) {
                        if (grid[i][j] == '.' && grid[i+1][j] == '.') {
                            grid[i][j] = '#'; grid[i+1][j] = '#';
                            if (checkv(i, j) > max) {max = checkv(i, j); indi = i; indj = j;}
                            grid[i][j] = '.'; grid[i+1][j] = '.';
                        }

                    }
                }
                grid[indi][indj] = '#';
                grid[indi+1][indj] = '#';
                checkdelv(indi, indj);
                ans[t][0] = indi;
                ans[t][1] = indj;
            }
            else {
                int max = -1, indi = -1, indj = -1;
                for (int i=1; i<=4; i++) {
                    for (int j=1; j<=3; j++) {
                        if (grid[i][j] == '.' && grid[i][j+1] == '.') {
                            grid[i][j] = '#'; grid[i][j+1] = '#';
                            if (checkh(i, j) > max) {max = checkh(i, j); indi = i; indj = j;}
                            grid[i][j] = '.'; grid[i][j+1] = '.';
                        }
                    }
                }
                grid[indi][indj] = '#';
                grid[indi][indj+1] = '#';
                checkdelh(indi, indj);
                ans[t][0] = indi;
                ans[t][1] = indj;
            }
        }
        for (int t=0; t<n; t++) out.printf("%d %d\n", ans[t][0], ans[t][1]);
    }
    private static void run() throws Exception
    {
//        in = new Reader();
//        in = new Reader(new FileReader("input.txt"));
//        out = new PrintWriter(new FileWriter("output.txt"));
        in = oj ? new Reader() : new Reader(new FileReader("C:\\Users\\Suhaib\\Desktop\\input.txt"));
        out = new PrintWriter(System.out);
        long ti = System.currentTimeMillis();
        solve(); out.flush();
        if (!oj) System.out.println("\n"+(System.currentTimeMillis()-ti)+"ms");
    }
    public static void main(String[] args) throws Exception {run();}
}