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.util.StringTokenizer;

public class C {
	public static void main(String[] args) throws FileNotFoundException {
		int toFile = 0;
		InputStream inputStream;
		OutputStream outputStream;
		if (toFile == 0) {
			inputStream = System.in;
			outputStream = System.out;
		} else {
			inputStream = new FileInputStream(new File("C.in"));
			outputStream = new FileOutputStream(new File("C.out"));
		}
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(in, out);
		out.close();
	}


	class B {
		int x, y;

		public B(int x, int y) {
			this.x = x;
			this.y = y;
		}
	}

	static class TaskC {

		int [][] g = new int[4][4];

		public void solve(InputReader in, PrintWriter out) {
			String s = in.next();

			for (int i = 0; i < s.length(); i++) {
				boolean used = remove(s.charAt(i));
				if (!used) {
					fil(s.charAt(i));
				}
			}
		}

		private void fil(char c) {
			if (c == '0') { // vert
				for (int i = 2; i >= 0; i--) {
					for (int j = 0; j <= 3; j++) {
						if ((g[i][j] == 0) && (g[i + 1][j] == 0)) {
							g[i][j] = 1;
							g[i + 1][j] = 1;
							System.out.println((i + 1) + " " + (j + 1));
							return;
						}
					}
				}
			} else {
				for (int i = 3; i >= 0; i--) {
					for (int j = 0; j <= 2; j++) {
						if ((g[i][j] == 0) && (g[i][j + 1] == 0)) {
							g[i][j] = 1;
							g[i][j + 1] = 1;
							System.out.println((i + 1) + " " + (j + 1));
							return;
						}
					}
				}
			}
		}

		private boolean remove(char c) {
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					if (check_rem(i, j, c)) {
						System.out.println((i + 1) + " " + (j + 1));
						return true;
					}
				}
			}
			return false;
		}

		private boolean check_rem(int i, int j, char c) {
			if (c == '0') { // vert
				if ((g[i][j] == 0) && (i + 1 < 4) && (g[i + 1][j] == 0)) {
					g[i][j] = 1;
					g[i + 1][j] = 1;
					if (removed()) {
						return true;
					} else {
						g[i][j] = 0;
						g[i + 1][j] = 0;
						return false;
					}
				}
			}
			else {
				if ((g[i][j] == 0) && (j + 1 < 4) && (g[i][j + 1] == 0)) {
					g[i][j] = 1;
					g[i][j + 1] = 1;
					if (removed()) {
						return true;
					}
					else {
						g[i][j] = 0;
						g[i][j + 1] = 0;
						return false;
					}
				}
			}
			return false;
		}

		private boolean removed() {
			boolean result = false;
			for (int i = 0; i < 4; i++) {
				boolean f = true;
				for (int j = 0; j < 4; j++)
					if (g[i][j] == 0)
						f = false;
				if (f) {
					result = true;
					for (int j = 0; j < 4; j++)
						g[i][j] = 0;
				}
			}
			for (int i = 0; i < 4; i++) {
				boolean f = true;
				for (int j = 0; j < 4; j++)
					if (g[j][i] == 0)
						f = false;
				if (f) {
					result = true;
					for (int j = 0; j < 4; j++)
						g[j][i] = 0;
				}
			}
			return result;
		}


	}

	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());
		}

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