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.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author madi.sagimbekov
 */
public class C1104C {

    private static BufferedReader in;
    private static BufferedWriter out;

    private static List<Integer>[] list;
    private static int[] arr;
    private static int[][] dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    private static boolean[][] used = new boolean[4][4];

    public static void main(String[] args) throws IOException {
        open();

        char[] c = readString().toCharArray();

        for (int i = 0; i < c.length; i++) {
            int[] res = find(c[i]);
            out.write(res[0] + " " + res[1] + "\n");
            clear();
        }

        close();
    }

    private static void clear() {

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

        for (int i = 0; i < 4; i++) {
            boolean c = true;
            for (int j = 0; j < 4; j++) {
                if (!used[i][j]) {
                    c = false;
                }
            }
            if (c) {
                rows.add(i);
            }
            c = true;
            for (int j = 0; j < 4; j++) {
                if (!used[j][i]) {
                    c = false;
                }
            }
            if (c) {
                cols.add(i);
            }
        }

        for (int row : rows) {
            for (int i = 0; i < 4; i++) {
                used[row][i] = false;
            }
        }

        for (int col : cols) {
            for (int i = 0; i < 4; i++) {
                used[i][col] = false;
            }
        }
    }

    private static int[] find(char c) {
        int[] res = new int[2];

        if (c == '0') {
            for (int i = 0; i < 4; i++) {
                if (!used[0][i]) {
                    used[0][i] = true;
                    used[1][i] = true;
                    return new int[]{1, (i + 1)};
                }
            }
        } else {
            for (int i = 2; i < 4; i++) {
                for (int j = 0; j < 4; j+= 2) {
                    if (!used[i][j]) {
                        used[i][j] = true;
                        used[i][j + 1] = true;
                        return new int[]{i + 1, j + 1};
                    }
                }
            }
        }

        return res;
    }

    private static int[] readInts() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static int readInt() throws IOException {
        return Integer.parseInt(in.readLine());
    }

    private static long[] readLongs() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
    }

    private static long readLong() throws IOException {
        return Long.parseLong(in.readLine());
    }

    private static double[] readDoubles() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
    }

    private static double readDouble() throws IOException {
        return Double.parseDouble(in.readLine());
    }

    private static String readString() throws IOException {
        return in.readLine();
    }

    private static List<Integer>[] buildAdjacencyList(int n, int m) throws IOException {
        List<Integer>[] list = new ArrayList[n + 1];
        for (int i = 0; i <= n; i++) {
            list[i] = new ArrayList<>();
        }

        for (int i = 0; i < m; i++) {
            int[] e = readInts();
            list[e[0]].add(e[1]);
            list[e[1]].add(e[0]);
        }

        return list;
    }

    private static void open() {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new BufferedWriter(new OutputStreamWriter((System.out)));
    }

    private static void close() throws IOException {
        out.flush();
        out.close();
        in.close();
    }

}