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 javafx.util.Pair;

import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    class FastScanner {
        private BufferedReader bufferedReader;
        private StringTokenizer stringTokenizer;
        public FastScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException ignored){}
            }
            return stringTokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private FastScanner scanner;
    private PrintWriter printer;

    Main(InputStream scanner, PrintWriter printWriter) {
        this.scanner = new FastScanner(scanner);
        this.printer = printWriter;
    }

    int gcd (int a, int b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    boolean isPrime(int n) {
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    List<Integer>prostMnoj(int n) {
        ArrayList<Integer> r = new ArrayList<>();
        int p = 2;
        while(n != 1) {
            while(n % p == 0) {
                n /= p;
                r.add(p);
            }
            p++;
            while(!isPrime(p)) {
                p++;
            }
        }
        return r;
    }

    List<Integer>allMnoj(List<Integer>a) {
        ArrayList<Integer>r = new ArrayList<>();
        boolean b[] = new boolean[a.size() + 1];
        while(!b[0]) {
            int i = a.size();
            while(b[i]) {
                i--;
            }
            b[i++] = true;
            while(i<b.length) {
                b[i++] = false;

            }
            int m = 1;
            for (i = 1; i < b.length; i++) {
                if (b[i]) {
                    m*=a.get(i-1);
                }
            }
            r.add(m);
        }
        return r;
    }

    double a(long n) {
        return (180.0 * (n-2)) / n;
    }

    void next (int a[]) {
        for (int i = a.length - 2; i >= 0; i--) {
            if (a[i] < a[i+1]) {
                for (int j = a.length - 1;; j--) {
                    if (a[j] > a[i]) {
                        int t = a[i];
                        a[i] = a[j];
                        a[j] = t;
                        break;
                    }
                }
                for (int j = i + 1; j <= i + ((a.length - 1) - i) / 2; j++) {
                    int t = a[j];
                    int k = (a.length - 1) - (j - (i + 1));
                    a[j] = a[k];
                    a[k] = t;
                }
                break;
            }
        }
    }

    int fact(int n) {
        if (n == 1) return 1;
        return n * fact(n - 1);
    }

    int dfs(List<List<Integer>>g, int v, boolean used[]) {
        if (used[v]) return 0;
        used[v] = true;
        int sum = 1;
        for (int i = 0; i < g.get(v).size(); i++) {
            sum += dfs(g, g.get(v).get(i), used);
        }
        return sum;
    }

    int find(List<List<Integer>>g, int v, int x, boolean used[]) {
        if (used[v]) return -1;
        used[v] = true;
        if (g.get(v).contains(x)) return v;
        for (int i = 0; i < g.get(v).size(); i++) {
            int res = find(g, g.get(v).get(i), x, used);
            if (res != -1) return res;
        }
        return -1;
    }

    int dp[] = new int[101];
    {
        Arrays.fill(dp, -1);
    }

    int[] ms(int n) {
        int dp[] = new int[n + 1];
        int tp[] = new int[n + 1];
        dp[1] = 0;
        tp[1] = 1;
        for (int i = 2; i <= n; i++) {
            int t = i - 1;
            dp[i] = dp[i - 1];
            if (i % 2 == 0 && dp[i / 2] < dp[i]) {
                dp[i] = dp[i / 2];
                t = i / 2;
            }
            if (i % 3 == 0 && dp[i / 3] < dp[i]) {
                dp[i] = dp[i / 3];
                t = i / 3;
            }
            dp[i]++;
            tp[i] = t;
        }
        printer.println(dp[n]);
        int t = n;
        StringBuilder s = new StringBuilder();
        while (t != 1) {
            s.insert(0, t);
            s.insert(0, " ");
            t = tp[t];
        }
        s.insert(0, "1");
        printer.println(s);
        return dp;
    }

    double gg(List<List<Integer>>g, boolean used[], int v) {
        List<Integer> gv = g.get(v);
        used[v] = true;
        if (gv.isEmpty()) return 0;
        if (gv.size() == 1 && used[gv.get(0)]) {
            return 0;
        }
        int k = 0;
        double sum = 0;
        for (int i = 0; i < gv.size(); i++) {
            if (!used[gv.get(i)]) {
                sum += gg(g, used, gv.get(i));
                k++;
            }
        }
        return sum / k + 1;
    }

    long fib(long n)
    {
        if (n < 1) return 0;
        long a = 0;
        long b = 1;
        for (int i = 2; i <= n; i++) {
            long t = a + b;
            a = b;
            b = t;
        }
        return b;
    }

    List<List<Integer>>g = new ArrayList<>();
    int d[];
    int a[];

    int dist(int x, int y) {
        return 0;
    }

    int ggg(int v) {
        if (d[v] == -1) {
            d[v] = 1;
            int x = a[v];
            for (int i = 0; i < g.get(v).size(); i++) {
                d[v] = Math.max(d[v], gcd(x, ggg(g.get(v).get(i))));
            }
        }
        return d[v];
    }

    int dd[][] = new int[200001][3];
    {
        for (int i = 0; i < dd.length; i++) {
            Arrays.fill(dd[i], -1);
        }
    }

    final int mod = 1_000_000_007;


    int f(int n, int i, int s, int l, int r) {
        if (dd[i][s] == -1) {
            if (i == n - 1) {
                int j = l;
                while ((s + j) % 3 != 0) {
                    j++;
                }
                if (j > r) dd[i][s] =  0;
                else dd[i][s] = (1 + (r - j) / 3) % mod;
            } else {
                long plus0 = (long)(Math.ceil((r - (l + 0) + 1) / 3.0) % mod);
                long plus1 = (long)(Math.ceil((r - (l + 1) + 1) / 3.0) % mod);
                long plus2 = (long)(Math.ceil((r - (l + 2) + 1) / 3.0) % mod);
                long k1 = (f(n, i + 1, (s + l + 0) % 3, l, r) * plus0) % mod;
                long k2 = (f(n, i + 1, (s + l + 1) % 3, l, r) * plus1) % mod;
                long k3 = (f(n, i + 1, (s + l + 2) % 3, l, r) * plus2) % mod;
                dd[i][s] = (int)(((k1 + k2) % mod) + k3) % mod;
            }
        }
        return dd[i][s] % mod;
    }

    String trim(String s) {
        if (s.length() < 2) return s;
        if (s.charAt(0) == s.charAt(1)) {
            return trim(s.substring(2));
        }
        String s2 = s.substring(1);
        if (s2.charAt(0) == s.charAt(0)) {
            return trim(s2.substring(1));
        }
        return s;
    }

    boolean [][]map = new boolean[4][4];

    void run() {
        String s = scanner.next();
        int l1 = 0;
        int l2 = 0;
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) == '1' ? 1 : 0;
            if (c == 0) {
                printer.println("1 " + (l1 + 1));
                l1 = (l1 + 1) % 4;
            }
            else {
                int t = l2 == 0 ? 1 : 3;
                printer.println("3 " + (t));
                l2 = (l2 + 1) % 2;
            }
        }
        printer.flush();
        printer.close();
    }

    public static void main(String [] args) {
        long start = System.currentTimeMillis();
        new Main(System.in, new PrintWriter(System.out)).run();
        long finish = System.currentTimeMillis();
        System.err.println(finish - start + "ms");
    }
}