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:
//package CodeForces.C534;

import javafx.util.Pair;

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class C {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static List<List<Integer>> grid = new ArrayList<>();
    static PrintWriter out1;

    static class Helper {
        static Pair<Integer,Integer> nextEmpty (boolean isvertical) {
            if (isvertical) {
//                out1.println("ver");
                for (int i = 0; i < 3; i++) {
                    for (int j = 0; j < 4; j++) {
                        if (grid.get(i).get(j) == 0 && grid.get(i+1).get(j) == 0) {
                            grid.get(i).set(j,1); grid.get(i+1).set(j,1);
                            return new Pair<>(i+1, j+1);
                        }
                    }
                }
            } else {
  //              out1.println("hor");
                for (int i=0;i<4;i++) {
                    for (int j=0;j<3;j++) {
                        if (grid.get(i).get(j) == 0 && grid.get(i).get(j+1) == 0) {
                            grid.get(i).set(j,1); grid.get(i).set(j+1,1);
                            return new Pair<>(i+1, j+1);
                        }
                    }
                }
            }
            return null;
        }

        static void checkRows() {
            for (int i=0;i<4;i++) {
                boolean allset = true;
                for (int j=0;j<4;j++) {
                    if (grid.get(i).get(j) == 0) allset = false;
                }
                if (allset) {
                    for (int j=0;j<4;j++) {
                        grid.get(i).set(j,0);
                    }
                }
            }
        }

        static  void checkCols() {
            for (int j=0;j<4;j++) {
                boolean allset = true;
                for (int i=0;i<4;i++) {
                    if (grid.get(i).get(j) == 0 ) allset = false;
                }
                if (allset) {
                    for (int i=0;i<4;i++) {
                        grid.get(i).set(j,0);
                    }
                }
            }
        }

        static void  printGrid() {
            for (int i=0;i<4;i++) {
                for (int j=0;j<4;j++){
                    out1.print(grid.get(i).get(j)); out1.print(" ");
                }
                out1.println();
            }
        }
    }

    static class TaskE {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            out1 =out;
            String q = in.next();

            int vt = 0; int hc = 0;
            for (int i=0;i<q.length();i++) {
                if (q.charAt(i)=='0') {
                    if (vt==0) { out.println("3 1"); vt=1; continue;}
                    else {out.println("1 1"); vt=0; continue;}
                }  else {
                    if (hc==0) {out.println("1 3"); hc=1; continue;}
                    else {out.println("1 1"); hc=0; continue;}
                }

            }

           /* for (int i=0;i<4;i++) {
                grid.add(new ArrayList<>());
                for (int j=0;j<4;j++) {
                    grid.get(i).add(0);
                }
            }

            for (int i=0;i<q.length();i++) {
                out.println(q.charAt(i)); out.flush();
                if (q.charAt(i)=='0') {
                    Pair temp = Helper.nextEmpty(true);
                    out.print(temp.getKey() + " "  + temp.getValue()); out.println();
                } else {
                    Pair temp = Helper.nextEmpty(false);
                    out.print(temp.getKey() + " "  + temp.getValue()); out.println();
                }
                Helper.checkRows();
                Helper.checkCols();
                Helper.printGrid();
                out.flush();

            }*/

        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}