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.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.InputMismatchException;

/**
 * @author thesparkboy
 *
 */

public class A2 {

	// Code Begins Here

	static int[][] grid = new int[4][4];

	static void reset() {
		ArrayList<Integer> r = new ArrayList<>();
		ArrayList<Integer> c = new ArrayList<>();
		for (int i = 0; i < 4; i++) {
			int count = 0;
			for (int j = 0; j < 4; j++) {
				if (grid[i][j] == 1) {
					count++;
				}
			}
			if (count == 4) {
				r.add(i);
			}
		}
		for (int i = 0; i < 4; i++) {
			int count = 0;
			for (int j = 0; j < 4; j++) {
				if (grid[j][i] == 1) {
					count++;
				}
			}
			if (count == 4) {
				c.add(i);
			}
		}
		for (int x : r) {
			for (int i = 0; i < 4; i++) {
				grid[x][i] = 0;
			}
		}
		for (int x : c) {
			for (int i = 0; i < 4; i++) {
				grid[i][x] = 0;
			}
		}
	}

	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		int t = 1;
		while (t-- > 0) {
			String str = in.readString();
			int n = str.length();
			StringBuilder ans = new StringBuilder();
			for (int j = 0; j < n; j++) {
				if (str.charAt(j) == '0') {
					for (int i = 0; i < 3; i++) {
						int flag = 0;
						for (int k = 0; k < 4; k++) {
							if (grid[i][k] == 0 && grid[i + 1][k] == 0) {
								grid[i][k] = 1;
								grid[i + 1][k] = 1;
								ans.append(i + 1 + " " + (k + 1));
								flag = 1;
								break;
							}
						}
						if (flag == 1) {
							break;
						}
					}
				} else {
					for (int i = 3; i >= 0; i--) {
						int flag = 0;
						for (int k = 3; k >= 1; k--) {
							if (grid[i][k] == 0 && grid[i][k - 1] == 0) {
								grid[i][k] = 1;
								grid[i][k - 1] = 1;
								ans.append(i + 1 + " " + (k));
								flag = 1;
								break;
							}
						}
						if (flag == 1) {
							break;
						}
					}
				}
				reset();
				ans.append("\n");
			}
			System.out.println(ans);
		}
		out.close();
	}

	// Code Ends Here

	static int power(int x, int y, int p) {
		int res = 1;
		x = x % p;
		while (y > 0) {
			if ((y & 1) == 1)
				res = (res * x) % p;

			y = y >> 1;
			x = (x * x) % p;
		}
		return res;
	}

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

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

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public long readLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			long sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int readInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuffer res = new StringBuffer();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

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

		public String next() {
			return readString();
		}
	}

	private static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(outputStream);
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}
	}
}