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.BigDecimal;
import java.math.RoundingMode;
import java.util.*;


/**
 * @authod Rashedul Hasan Rijul
 */
public class Solution {

    FastReader fastReader;
    OutputStream outputStream = System.out;
    PrintWriter out;
    List<Node> answer;

    Set<Memo> set;
    String s;

    int on(int n, int k) {
        return (n | 1 << k);
    }

    int off(int n, int k) {
        return (n - (1 << k));
    }

    boolean check(int n, int k) {
        return ((n & (1 << k)) == (1 << k));
    }

    public Solution() {
    }

    public Solution(FastReader fastReader) {
        this.fastReader = fastReader;
        this.out = new PrintWriter(outputStream, true);
    }

    public void solve() {

        s = fastReader.next();

        answer = new ArrayList<>();
        set = new HashSet<>();

        cal(0, 0);

        for (int i = answer.size() - 1; i >= 0; i--) {
            System.out.println(answer.get(i).r + " " + answer.get(i).c);
        }
    }

    public boolean cal(int ind, int mask) {

        if (s.length() == ind) {
            return true;
        }

        int pos;

        List<Integer> rows, cols;

        rows = new ArrayList<>();
        cols = new ArrayList<>();

        for (int i = 0; i < 4; i++) {
            int cnt = 0;
            for (int j = 0; j < 4; j++) {
                pos = i * 4 + j;
                if (check(mask, pos)) {
                    cnt++;
                }
            }
            if (cnt == 4) {
                rows.add(i);
            }

            cnt = 0;
            for (int j = 0; j < 4; j++) {
                pos = j * 4 + i;
                if (check(mask, pos)) {
                    cnt++;
                }
            }
            if (cnt == 4) {
                cols.add(i);
            }
        }

        for (int i : rows) {
            for (int j = 0; j < 4; j++) {
                pos = i * 4 + j;
                if(check(mask,pos)) {
                    mask = off(mask, pos);
                }
            }
        }
        for (int j : cols) {
            for (int i = 0; i < 4; i++) {
                pos = i * 4 + j;
                if(check(mask,pos)) {
                    mask = off(mask, pos);
                }
            }
        }

        Memo memo = new Memo(mask, ind);
        if (set.contains(memo)) {
            return false;
        }
        set.add(memo);

        if (s.charAt(ind) == '0') {
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 4; j++) {
                    if (findResult(ind, mask, i, j, '0')) {
                        answer.add(new Node(i + 1, j + 1));
                        return true;
                    }
                }
            }
        } else {
            for (int i = 0; i < 4; i++) {
                for (int j = 0; j < 3; j++) {
                    if (findResult(ind, mask, i, j, '1')) {
                        answer.add(new Node(i + 1, j + 1));
                        return true;
                    }
                }
            }
        }

        return false;
    }

    private boolean findResult(int ind, int mask, int i, int j, char ch) {


        int pos;
        int pos1;
        pos = i * 4 + j;
        if (check(mask, pos)) {
            return false;
        }

        if (ch == '0') {
            pos1 = ((i + 1) * 4) + j;
        } else {
            pos1 = (i * 4) + (j + 1);
        }
        if (check(mask, pos1)) {
            return false;
        }

        int newMask = on(mask, pos);
        newMask = on(newMask, pos1);

        if (cal(ind + 1, newMask)) {
            return true;
        }
        return false;
    }


    private int getCol(int ind) {
        return ind % 4;
    }

    private int getRow(int ind) {
        return ind / 4;
    }


    private static double round(double value, int places) {
        if (places < 0) throw new IllegalArgumentException();

        BigDecimal bd = new BigDecimal(Double.toString(value));
        bd = bd.setScale(places, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }

    public static void main(String args[]) throws FileNotFoundException {

        // for testing in local
        // FastReader fastReader = FastReader.getFileReader("in.txt");

        FastReader fastReader = FastReader.getDefaultReader();

        Solution soln = new Solution(fastReader);
        soln.solve();
    }


    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public static FastReader getFileReader(String fileName) throws FileNotFoundException {
            return new FastReader(new InputStreamReader(new FileInputStream(new File("in.txt"))));
        }

        public static FastReader getDefaultReader() throws FileNotFoundException {
            return new FastReader();
        }

        public FastReader(InputStreamReader inputStreamReader) {
            br = new BufferedReader(inputStreamReader);
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static class Memo {

        int mask;
        int ind;

        public Memo(int mask, int ind) {
            this.mask = mask;
            this.ind = ind;
        }

        @Override
        public String toString() {
            return "Memo{" +
                    "mask=" + mask +
                    ", ind=" + ind +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Memo memo = (Memo) o;
            return mask == memo.mask &&
                    ind == memo.ind;
        }

        @Override
        public int hashCode() {
            return Objects.hash(mask, ind);
        }
    }

    static class Node {

        int r, c;

        public Node(int r, int c) {
            this.r = r;
            this.c = c;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Node node = (Node) o;
            return r == node.r &&
                    c == node.c;
        }

        @Override
        public int hashCode() {
            return Objects.hash(r, c);
        }
    }
}