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.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map.Entry;

import java.util.Random;
import java.util.TreeSet;

public final class CF_534_D1_A
{


	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}

	static long mod=1000000007;
	static int CX=64;


	// Global vars
	static BufferedWriter out;
	static InputReader reader;

	static long A,B;

	//static int[] pos;
	static Composite[] pos;


	static class Composite implements Comparable<Composite>{
		int x;
		int idx;

		public int compareTo(Composite X) {
			if (x!=X.x)
				return x-X.x;
			return idx-X.idx;
		}

		public Composite(int x, int idx) {
			this.x = x;
			this.idx = idx;
		}




	}


	static long powerMod(long b,long e,long m){
		long x=1;
		while (e>0) {
			if (e%2==1)
				x=(b*x)%m;
			b=(b*b)%m;
			e=e/2;
		}
		return x; 
	}

	static long inv(long x,long mod) {
		return powerMod(x,mod-2,mod);
	}

	static long[] fact;

	static void process() throws Exception {

		Locale.setDefault(Locale.US);
		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader = new InputReader(System.in);

		String s=reader.readString();
		int L=s.length();
		int vert=0;
		int hor=0;
		for (int i=0;i<L;i++) {
			int x=s.charAt(i)-'0';
			int u=0,v=0;
			if (x==0) {
				u=0;
				v=vert;
				vert++;
				if (vert==4)
					vert=0;
			} else {
				if (hor==0) {
					
					u=2;
					v=0;
				}
				if (hor==1) {
					
					u=2;
					v=2;
				}
				if (hor==2) {
					u=3;
					v=0;
				}
				if (hor==3) {
					u=3;
					v=2;
				}
				hor++;
				if (hor==4)
					hor=0;
			
			
			}
	
			output((u+1)+" "+(v+1));
		}
	



	try {
		out.close();
	} catch (Exception e) {
	}

}

public static void main(String[] args) throws Exception {
	process();

}

static final class InputReader {
	private final InputStream stream;
	private final byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	private int read() throws IOException {
		if (curChar >= numChars) {
			curChar = 0;
			numChars = stream.read(buf);
			if (numChars <= 0) {
				return -1;
			}
		}
		return buf[curChar++];
	}

	public final String readString() throws IOException {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.append((char) c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public final int readInt() throws IOException {
		int c = read();
		boolean neg = false;
		while (isSpaceChar(c)) {
			c = read();
		}
		char d = (char) c;
		// log("d:"+d);
		if (d == '-') {
			neg = true;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		// log("res:"+res);
		if (neg)
			return -res;
		return res;

	}

	public final long readLong() throws IOException {
		int c = read();
		boolean neg = false;
		while (isSpaceChar(c)) {
			c = read();
		}
		char d = (char) c;
		// log("d:"+d);
		if (d == '-') {
			neg = true;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		// log("res:"+res);
		if (neg)
			return -res;
		return res;

	}

	private boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
}

}