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


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 = 0; i < 4; i++) {
						int flag = 0;
						for (int k = 0; k < 3; 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 + 1));
								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();
		}
	}
}


	import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.io.PrintWriter;
	import java.math.BigInteger;
	import java.util.*;

	public class usd {

		static int r=0;static int c=0;
		static void fillzero(int a[][],int n)
		{
			for(int i=0;i<n;i++)
			{
				for(int j=0;j<n-1;j++)
				{
					if(a[j][i]==0&&a[j+1][i]==0)
					{
						a[j][i]=1;a[j+1][i]=1;
						r=j;c=i;
						return;
					}
				}
			}
		}
		static void fillone(int a[][],int n)
		{
			for(int i=0;i<n;i++)
			{
				for(int j=0;j<n-1;j++)
				{
					if(a[i][j]==0&&a[i][j+1]==0)
					{
						a[i][j]=1;a[i][j+1]=1;
						r=i;c=j;
						return;
					}
				}
			}
		}

		static void check(int a[][],int n)
		{
			for(int i=0;i<4;i++)
			{
				if(a[i][0]==1&&a[i][1]==1&&a[i][2]==1&&a[i][3]==1)
				{
					a[i][0]=0;a[i][1]=0;a[i][2]=0;a[i][3]=0;
				}
			}
			for(int i=0;i<4;i++)
			{
				if(a[0][i]==1&&a[1][i]==1&&a[2][i]==1&&a[3][i]==1)
				{
					a[0][i]=0;a[1][i]=0;a[2][i]=0;a[3][i]=0;;
				}
			}
		}

		public static void main(String[] args) throws NumberFormatException, IOException {

		Scanner in=new Scanner (System.in);
		HashMap<String,Integer>map=new HashMap<String,Integer>();
		ArrayList<Integer>list=new ArrayList<Integer>();

		String s=in.next();
		int a[][]=new int[4][4];
		for(int i=0;i<s.length();i++)
		{
			char ch=s.charAt(i);
			if(ch=='0')
			{
				fillzero(a,4);
			}
			else
				fillone(a,4);
			System.out.println((r+1)+" "+(c+1));
			check(a,4);

		}

		}

	}


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

    }
}


//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("4 1"); vt=1; continue;}
                    else {out.println("2 1"); vt=0; continue;}
                }  else {
                    if (hc==0) {out.println("1 4"); hc=1; continue;}
                    else {out.println("1 2"); 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());
        }

    }
}


//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++){

                }
            }
        }
    }

    static class TaskE {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            out1 =out;
            String q = in.next();
            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++) {
                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();
            }

        }
    }

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

    }
}


import java.util.*;

public class gridgame {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String s=scan.next();
		int h=0,v=0;
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='0') {
				System.out.println("2 "+(v+1));
				v=(v+1)%4;
			}
			else {
				System.out.println("1 "+(h+1));
				h=(h+2)%4;
			}
		}
	}
}


//package sept;

import java.io.*;
import java.util.*;

public class TimePass implements Runnable {
    InputStream is;
    PrintWriter out;
    String INPUT = "1 2";
    //boolean debug=false;
    boolean debug=true;
    static long mod=998244353;
    static long mod2=1000000007;

    void solve() throws IOException
	{
    	char[] a=ns().toCharArray();
    	int n=a.length;
    	int[][] mat=new int[4][4];
    	for(int i=0;i<n;i++)
    	{
    		int ch=0;
    		if(a[i]=='0')
    		{
    			for(int j=0;j<3;j++)
    			{

    				//int ch=0;
    				for(int k=0;k<4;k++)
    				{
    					if(mat[j][k]==0 && mat[j+1][k]==0)
    					{
    						mat[j][k]=1;
    						mat[j+1][k]=1;
    						out.println((j+1)+" "+(k+1));
    						ch=1;
    						break;
    					}
    				}
    				if(ch==1)break;
    			}
    		}
    		else
    		{
    			for(int j=0;j<4;j++)
    			{
    				for(int k=0;k<3;k++)
    				{

    					if(mat[j][k]==0 && mat[j][k+1]==0)
    					{
    						out.println((j+1)+" "+(k+1));
    						mat[j][k]=1;
    						mat[j][k+1]=1;
    						ch=1;
    						break;
    					}
    				}
    				if(ch==1)break;
    			}
    		}
    		if(ch==1)
    		{
    			for(int j=0;j<4;j++)
    			{
    				int che=1;
    				for(int k=0;k<4;k++)
    				{
    					if(mat[j][k]==0)
    					{
    						che=0;
    						break;
    					}
    				}
    				if(che==1)
    				{
    					for(int k=0;k<4;k++)
        				{
        					mat[j][k]=0;
        				}
    				}
    			}
    		}
    	}
	}

	static int[][] packD(int n,int[] from,int[] to)
	{
		int[][] g=new int[n][];
		int[] p=new int[n];
		for(int f:from)
		{
			p[f]++;
		}
		int m=from.length;
		for(int i=0;i<n;i++)
		{
			g[i]=new int[p[i]];
		}
		for(int i=0;i<m;i++)
		{
			g[from[i]][--p[from[i]]]=to[i];
		}
		return g;
	}

    static class Pair
    {
        int a,b;
        public Pair(int a,int b)
        {
            this.a=a;
            this.b=b;
            //this.ind=ind;
        }
    }

    static long lcm(int a,int b)
    {
        long val=a;
        val*=b;
        return (val/gcd(a,b));
    }

    static long gcd(long a,long b)
    {
        if(a==0)return b;
        return gcd(b%a,a);
    }

    static int pow(int a, int b, int p)
    {
        long ans = 1, base = a;
        while (b!=0)
        {
            if ((b & 1)!=0)
            {
                ans *= base;
                ans%= p;
            }
            base *= base;
            base%= p;
            b >>= 1;
        }
        return (int)ans;
    }

    static int inv(int x, int p)
    {
        return pow(x, p - 2, p);
    }

    public void run()
    {
        if(debug)oj=true;
        is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
        try {
			solve();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        out.flush();
        tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception {new Thread(null,new TimePass(),"Main",1<<26).start();}

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package sept;

import java.io.*;
import java.util.*;

public class TimePass implements Runnable {
    InputStream is;
    PrintWriter out;
    String INPUT = "1 2";
    //boolean debug=false;
    boolean debug=true;
    static long mod=998244353;
    static long mod2=1000000007;

    void solve() throws IOException
	{
    	char[] a=ns().toCharArray();
    	int n=a.length;
    	int[][] mat=new int[4][4];
    	for(int i=0;i<n;i++)
    	{
    		int ch=0;
    		if(a[i]=='0')
    		{
    			for(int j=0;j<3;j++)
    			{
    				//int ch=0;
    				for(int k=0;k<4;k++)
    				{
    					if(mat[j][k]==0 && mat[j+1][k]==0)
    					{
    						mat[j][k]=1;
    						mat[j+1][k]=1;
    						out.println((j+1)+" "+(k+1));
    						ch=1;
    						break;
    					}
    				}
    				if(ch==1)break;
    			}
    		}
    		else
    		{
    			for(int j=0;j<4;j++)
    			{
    				for(int k=0;k<3;k++)
    				{

    					if(mat[j][k]==0 && mat[j][k+1]==0)
    					{
    						out.println((j+1)+" "+(k+1));
    						mat[j][k]=1;
    						mat[j][k+1]=1;
    						ch=1;
    						break;
    					}
    				}
    				if(ch==1)break;
    			}
    		}
    		if(ch==1)
    		{
    			for(int j=0;j<4;j++)
    			{
    				int che=1;
    				for(int k=0;k<4;k++)
    				{
    					if(mat[j][k]==0)
    					{
    						che=0;
    						break;
    					}
    				}
    				if(che==1)
    				{
    					for(int k=0;k<4;k++)
        				{
        					mat[j][k]=0;
        				}
    				}
    			}
    			for(int j=0;j<4;j++)
    			{
    				int che=1;
    				for(int k=0;k<4;k++)
    				{
    					if(mat[k][j]==0)
    					{
    						che=0;
    						break;
    					}
    				}
    				if(che==1)
    				{
    					for(int k=0;k<4;k++)
        				{
        					mat[k][j]=0;
        				}
    				}
    			}
    		}
    	}
	}

	static int[][] packD(int n,int[] from,int[] to)
	{
		int[][] g=new int[n][];
		int[] p=new int[n];
		for(int f:from)
		{
			p[f]++;
		}
		int m=from.length;
		for(int i=0;i<n;i++)
		{
			g[i]=new int[p[i]];
		}
		for(int i=0;i<m;i++)
		{
			g[from[i]][--p[from[i]]]=to[i];
		}
		return g;
	}

    static class Pair
    {
        int a,b;
        public Pair(int a,int b)
        {
            this.a=a;
            this.b=b;
            //this.ind=ind;
        }
    }

    static long lcm(int a,int b)
    {
        long val=a;
        val*=b;
        return (val/gcd(a,b));
    }

    static long gcd(long a,long b)
    {
        if(a==0)return b;
        return gcd(b%a,a);
    }

    static int pow(int a, int b, int p)
    {
        long ans = 1, base = a;
        while (b!=0)
        {
            if ((b & 1)!=0)
            {
                ans *= base;
                ans%= p;
            }
            base *= base;
            base%= p;
            b >>= 1;
        }
        return (int)ans;
    }

    static int inv(int x, int p)
    {
        return pow(x, p - 2, p);
    }

    public void run()
    {
        if(debug)oj=true;
        is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
        try {
			solve();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        out.flush();
        tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception {new Thread(null,new TimePass(),"Main",1<<26).start();}

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


//package sept;

import java.io.*;
import java.util.*;

public class TimePass implements Runnable {
    InputStream is;
    PrintWriter out;
    String INPUT = "1 2";
    //boolean debug=false;
    boolean debug=true;
    static long mod=998244353;
    static long mod2=1000000007;

    void solve() throws IOException
	{
    	char[] s=ns().toCharArray();
    	int n=s.length;
    	int c1=0,c2=0;
    	for(int i=0;i<n;i++)
    	{
    		if(s[i]=='0')
    		{
    			if(c1%2==0)
    			{
    				out.println(3+" "+1);
    			}
    			else
    			{
    				out.println(1+" "+1);
    			}
    			c1++;
    		}
    		else
    		{
    			if(c2%2==0)
    			{
    				out.println(1+" "+3);
    			}
    			else
    			{
    				out.println(1+" "+1);
    			}
    			c2++;
    		}
    	}
	}

	static int[][] packD(int n,int[] from,int[] to)
	{
		int[][] g=new int[n][];
		int[] p=new int[n];
		for(int f:from)
		{
			p[f]++;
		}
		int m=from.length;
		for(int i=0;i<n;i++)
		{
			g[i]=new int[p[i]];
		}
		for(int i=0;i<m;i++)
		{
			g[from[i]][--p[from[i]]]=to[i];
		}
		return g;
	}

    static class Pair
    {
        int a,b;
        public Pair(int a,int b)
        {
            this.a=a;
            this.b=b;
            //this.ind=ind;
        }
    }

    static long lcm(int a,int b)
    {
        long val=a;
        val*=b;
        return (val/gcd(a,b));
    }

    static long gcd(long a,long b)
    {
        if(a==0)return b;
        return gcd(b%a,a);
    }

    static int pow(int a, int b, int p)
    {
        long ans = 1, base = a;
        while (b!=0)
        {
            if ((b & 1)!=0)
            {
                ans *= base;
                ans%= p;
            }
            base *= base;
            base%= p;
            b >>= 1;
        }
        return (int)ans;
    }

    static int inv(int x, int p)
    {
        return pow(x, p - 2, p);
    }

    public void run()
    {
        if(debug)oj=true;
        is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
        try {
			solve();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        out.flush();
        tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception {new Thread(null,new TimePass(),"Main",1<<26).start();}

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class C
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         String input = st.nextToken();
         int hc = 0;
         int vc = 0;
         StringBuilder sb = new StringBuilder();
         for(char c: input.toCharArray())
         {
            if(c == '0')
            {
               vc++;
               if(vc%2 == 1)
                  sb.append("3 4");
               else
                  sb.append("1 4");
            }
            else
            {
               hc++;
               if(hc%2 == 1)
                  sb.append("1 1");
               else
                  sb.append("1 3");
            }
            sb.append("\n");
         }
         System.out.print(sb);
      }
   }


/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class C
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         String input = st.nextToken();
         int hc = 0;
         int vc = 0;
         StringBuilder sb = new StringBuilder();
         for(char c: input.toCharArray())
         {
            if(c == '0')
            {
               vc++;
               if(vc%2 == 1)
                  sb.append("3 4");
               else
                  sb.append("1 4");
            }
            else
            {
               hc++;
               if(hc%2 == 1)
                  sb.append("1 1");
               else
                  sb.append("3 1");
            }
            sb.append("\n");
         }
         System.out.print(sb);
      }
   }


//package year2019.month01.cf.round534;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class GridGame {

    boolean ONLINE_JUDGE = (System.getProperty("ONLINE_JUDGE") != null);

    public GridGame() throws IOException {
        InputReader in;
        if (ONLINE_JUDGE) {
            in = new InputReader(System.in);
        } else {
            in = new InputReader(new FileInputStream("/Users/karj/Competitive Programming/input.txt"));
        }
        PrintWriter out = new PrintWriter(System.out);

        int T = 1;
        for (int caseNo = 1; caseNo <= T; caseNo++) {
            solve(caseNo, in, out);
        }

        out.close();
    }

    private void solve(int caseNo, InputReader in, PrintWriter out) throws IOException {
        char s[] = in.nextString().toCharArray();
        int grid[][] = new int[4][4];
        int row[] = new int[s.length];
        int col[] = new int[s.length];
        int cr[] = new int[4];
        int cc[] = new int[4];
        for (int i = 0; i < s.length; i++) {
            Arrays.fill(cr, 0);
            Arrays.fill(cc, 0);
            if (s[i] == '0') {
                outerr:
                for (int r = 0; r < 1; r++) {
                    for (int c = 0; c < 4; c++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            row[i] = r + 1;
                            col[i] = c + 1;
                            grid[r][c] = 1;
                            grid[r + 1][c] = 1;
                            break outerr;
                        }
                    }
                }
            } else {
                outerc:
                for (int r = 2; r < 4; r++) {
                    for (int c = 0; c < 3; c++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            row[i] = r + 1;
                            col[i] = c + 1;
                            grid[r][c] = 1;
                            grid[r][c + 1] = 1;
                            break outerc;
                        }
                    }
                }
            }
            debug(s[i]);
            for (int rrr[] : grid) debug(rrr);
            for (int r = 0; r < 4; r++) {
                int allFull = 1;
                for (int c = 0; c < 4; c++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cr[r] = 1;
                }
            }
            for (int c = 0; c < 4; c++) {
                int allFull = 1;
                for (int r = 0; r < 4; r++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cc[c] = 1;
                }
            }
            for (int r = 0; r < 4; r++) {
                if (cr[r] == 1) {
                    for (int c = 0; c < 4; c++) {
                        grid[r][c] = 0;
                    }
                }
            }
            for (int c = 0; c < 4; c++) {
                if (cc[c] == 1) {
                    for (int r = 0; r < 4; r++) {
                        grid[r][c] = 0;
                    }
                }
            }
            debug(s[i]);
            for (int rrr[] : grid) debug(rrr);
        }
        for (int i = 0; i < s.length; i++) {
            out.println(row[i] + " " + col[i]);
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

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

        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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }

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

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

        public int nextInteger() {
            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 Long nextLong() {
            return Long.parseLong(nextString());
        }

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

        public char nextCharacter() {
            return nextString().charAt(0);
        }
    }

    private void debug(Object... o) {
        if (ONLINE_JUDGE) {
            return;
        }
        System.out.println(Arrays.deepToString(o));
    }

    public static void main(String args[]) throws IOException {
        new GridGame();
    }
}


//package year2019.month01.cf.round534;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class GridGame {

    boolean ONLINE_JUDGE = (System.getProperty("ONLINE_JUDGE") != null);

    public GridGame() throws IOException {
        InputReader in;
        if (ONLINE_JUDGE) {
            in = new InputReader(System.in);
        } else {
            in = new InputReader(new FileInputStream("/Users/karj/Competitive Programming/input.txt"));
        }
        PrintWriter out = new PrintWriter(System.out);

        int T = 1;
        for (int caseNo = 1; caseNo <= T; caseNo++) {
            solve(caseNo, in, out);
        }

        out.close();
    }

    private void solve(int caseNo, InputReader in, PrintWriter out) throws IOException {
        char s[] = in.nextString().toCharArray();
        int grid[][] = new int[4][4];
        int row[] = new int[s.length];
        int col[] = new int[s.length];
        int cr[] = new int[4];
        int cc[] = new int[4];
        for (int i = 0; i < s.length; i++) {
            Arrays.fill(cr, 0);
            Arrays.fill(cc, 0);
            int r1 = Integer.MAX_VALUE - 1234567,
                    c1 = Integer.MAX_VALUE - 1234567,
                    r2 = Integer.MAX_VALUE - 1234567,
                    c2 = Integer.MAX_VALUE - 1234567;
            if (s[i] == '0') {
                outerr1:
                for (int r = 0; r < 3; r++) {
                    for (int c = 0; c < 4; c++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            r1 = r; c1 = c;
                            break outerr1;
                        }
                    }
                }
                outerr2:
                for (int c = 0; c < 4; c++) {
                    for (int r = 0; r < 3; r++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            r2 = r; c2 = c;
                            break outerr2;
                        }
                    }
                }
                if (r1 + c1 <= r2 + c2) {
                    row[i] = r1 + 1;
                    col[i] = c1 + 1;
                    grid[r1][c1] = 1;
                    grid[r1 + 1][c1] = 1;
                } else {
                    row[i] = r2 + 1;
                    col[i] = c2 + 1;
                    grid[r2][c2] = 1;
                    grid[r2 + 1][c2] = 1;
                }
            } else {
                outerc1:
                for (int r = 0; r < 4; r++) {
                    for (int c = 0; c < 3; c++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            r1 = r; c1 = c;
                            break outerc1;
                        }
                    }
                }
                outerc2:
                for (int c = 0; c < 3; c++) {
                    for (int r = 0; r < 4; r++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            r2 = r; c2 = c;
                            break outerc2;
                        }
                    }
                }
                if (r1 + c1 <= r2 + c2) {
                    row[i] = r1 + 1;
                    col[i] = c1 + 1;
                    grid[r1][c1] = 1;
                    grid[r1][c1 + 1] = 1;
                } else {
                    row[i] = r2 + 1;
                    col[i] = c2 + 1;
                    grid[r2][c2] = 1;
                    grid[r2][c2 + 1] = 1;
                }
            }
            debug(s[i], "placed", row[i], col[i]);
            for (int rrr[] : grid) debug(rrr);
            for (int r = 0; r < 4; r++) {
                int allFull = 1;
                for (int c = 0; c < 4; c++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cr[r] = 1;
                }
            }
            for (int c = 0; c < 4; c++) {
                int allFull = 1;
                for (int r = 0; r < 4; r++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cc[c] = 1;
                }
            }
            for (int r = 0; r < 4; r++) {
                if (cr[r] == 1) {
                    for (int c = 0; c < 4; c++) {
                        grid[r][c] = 0;
                    }
                    cr[r] = 0;
                }
            }
            for (int c = 0; c < 4; c++) {
                if (cc[c] == 1) {
                    for (int r = 0; r < 4; r++) {
                        grid[r][c] = 0;
                    }
                    cc[c] = 0;
                }
            }
            debug(s[i], "cleared");
            for (int rrr[] : grid) debug(rrr);
        }
        for (int i = 0; i < s.length; i++) {
            out.println(row[i] + " " + col[i]);
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

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

        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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }

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

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

        public int nextInteger() {
            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 Long nextLong() {
            return Long.parseLong(nextString());
        }

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

        public char nextCharacter() {
            return nextString().charAt(0);
        }
    }

    private void debug(Object... o) {
        if (ONLINE_JUDGE) {
            return;
        }
        System.out.println(Arrays.deepToString(o));
    }

    public static void main(String args[]) throws IOException {
        new GridGame();
    }
}


//package year2019.month01.cf.round534;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class GridGame {

    boolean ONLINE_JUDGE = (System.getProperty("ONLINE_JUDGE") != null);

    public GridGame() throws IOException {
        InputReader in;
        if (ONLINE_JUDGE) {
            in = new InputReader(System.in);
        } else {
            in = new InputReader(new FileInputStream("/Users/karj/Competitive Programming/input.txt"));
        }
        PrintWriter out = new PrintWriter(System.out);

        int T = 1;
        for (int caseNo = 1; caseNo <= T; caseNo++) {
            solve(caseNo, in, out);
        }

        out.close();
    }

    private void solve(int caseNo, InputReader in, PrintWriter out) throws IOException {
        char s[] = in.nextString().toCharArray();
        int grid[][] = new int[4][4];
        int row[] = new int[s.length];
        int col[] = new int[s.length];
        int cr[] = new int[4];
        int cc[] = new int[4];
        for (int i = 0; i < s.length; i++) {
            Arrays.fill(cr, 0);
            Arrays.fill(cc, 0);
            if (s[i] == '0') {
                outerr:
                for (int r = 0; r < 3; r++) {
                    for (int c = 0; c < 4; c++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            row[i] = r + 1;
                            col[i] = c + 1;
                            grid[r][c] = 1;
                            grid[r + 1][c] = 1;
                            break outerr;
                        }
                    }
                }
            } else {
                outerc:
                for (int r = 0; r < 4; r++) {
                    for (int c = 0; c < 3; c++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            row[i] = r + 1;
                            col[i] = c + 1;
                            grid[r][c] = 1;
                            grid[r][c + 1] = 1;
                            break outerc;
                        }
                    }
                }
            }
            debug(s[i]);
            for (int rrr[] : grid) debug(rrr);
            for (int r = 0; r < 4; r++) {
                int allFull = 1;
                for (int c = 0; c < 4; c++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cr[r] = 1;
                }
            }
            for (int c = 0; c < 4; c++) {
                int allFull = 1;
                for (int r = 0; r < 4; r++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cc[c] = 1;
                }
            }
            for (int r = 0; r < 4; r++) {
                if (cr[r] == 1) {
                    for (int c = 0; c < 4; c++) {
                        grid[r][c] = 0;
                    }
                }
            }
            for (int c = 0; c < 4; c++) {
                if (cc[c] == 1) {
                    for (int r = 0; r < 4; r++) {
                        grid[r][c] = 0;
                    }
                }
            }
            debug(s[i]);
            for (int rrr[] : grid) debug(rrr);
        }
        for (int i = 0; i < s.length; i++) {
            out.println(row[i] + " " + col[i]);
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

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

        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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }

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

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

        public int nextInteger() {
            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 Long nextLong() {
            return Long.parseLong(nextString());
        }

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

        public char nextCharacter() {
            return nextString().charAt(0);
        }
    }

    private void debug(Object... o) {
        if (ONLINE_JUDGE) {
            return;
        }
        System.out.println(Arrays.deepToString(o));
    }

    public static void main(String args[]) throws IOException {
        new GridGame();
    }
}


//package year2019.month01.cf.round534;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class GridGame {

    boolean ONLINE_JUDGE = (System.getProperty("ONLINE_JUDGE") != null);

    public GridGame() throws IOException {
        InputReader in;
        if (ONLINE_JUDGE) {
            in = new InputReader(System.in);
        } else {
            in = new InputReader(new FileInputStream("/Users/karj/Competitive Programming/input.txt"));
        }
        PrintWriter out = new PrintWriter(System.out);

        int T = 1;
        for (int caseNo = 1; caseNo <= T; caseNo++) {
            solve(caseNo, in, out);
        }

        out.close();
    }

    private void solve(int caseNo, InputReader in, PrintWriter out) throws IOException {
        char s[] = in.nextString().toCharArray();
        int grid[][] = new int[4][4];
        int row[] = new int[s.length];
        int col[] = new int[s.length];
        int cr[] = new int[4];
        int cc[] = new int[4];
        for (int i = 0; i < s.length; i++) {
            Arrays.fill(cr, 0);
            Arrays.fill(cc, 0);
            int r1 = 10,
                    c1 = 10,
                    r2 = 10,
                    c2 = 10;
            if (s[i] == '0') {
                outerr1:
                for (int r = 0; r < 3; r++) {
                    for (int c = 0; c < 4; c++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            r1 = r; c1 = c;
                            break outerr1;
                        }
                    }
                }
                outerr2:
                for (int c = 0; c < 4; c++) {
                    for (int r = 0; r < 3; r++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            r2 = r; c2 = c;
                            break outerr2;
                        }
                    }
                }
                if (r1 + c1 <= r2 + c2) {
                    row[i] = r1 + 1;
                    col[i] = c1 + 1;
                    grid[r1][c1] = 1;
                    grid[r1 + 1][c1] = 1;
                } else {
                    row[i] = r2 + 1;
                    col[i] = c2 + 1;
                    grid[r2][c2] = 1;
                    grid[r2 + 1][c2] = 1;
                }
            } else {
                outerc1:
                for (int r = 0; r < 4; r++) {
                    for (int c = 0; c < 3; c++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            r1 = r; c1 = c;
                            break outerc1;
                        }
                    }
                }
                outerc2:
                for (int c = 0; c < 3; c++) {
                    for (int r = 0; r < 4; r++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            r2 = r; c2 = c;
                            break outerc2;
                        }
                    }
                }
                if (r1 + c1 <= r2 + c2) {
                    row[i] = r1 + 1;
                    col[i] = c1 + 1;
                    grid[r1][c1] = 1;
                    grid[r1][c1 + 1] = 1;
                } else {
                    row[i] = r2 + 1;
                    col[i] = c2 + 1;
                    grid[r2][c2] = 1;
                    grid[r2][c2 + 1] = 1;
                }
            }
            debug(s[i], "placed", row[i], col[i]);
            for (int rrr[] : grid) debug(rrr);
            for (int r = 0; r < 4; r++) {
                int allFull = 1;
                for (int c = 0; c < 4; c++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cr[r] = 1;
                }
            }
            for (int c = 0; c < 4; c++) {
                int allFull = 1;
                for (int r = 0; r < 4; r++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cc[c] = 1;
                }
            }
            for (int r = 0; r < 4; r++) {
                if (cr[r] == 1) {
                    for (int c = 0; c < 4; c++) {
                        grid[r][c] = 0;
                    }
                    cr[r] = 0;
                }
            }
            for (int c = 0; c < 4; c++) {
                if (cc[c] == 1) {
                    for (int r = 0; r < 4; r++) {
                        grid[r][c] = 0;
                    }
                    cc[c] = 0;
                }
            }
            debug(s[i], "cleared");
            for (int rrr[] : grid) debug(rrr);
        }
        for (int i = 0; i < s.length; i++) {
            out.println(row[i] + " " + col[i]);
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

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

        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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }

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

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

        public int nextInteger() {
            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 Long nextLong() {
            return Long.parseLong(nextString());
        }

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

        public char nextCharacter() {
            return nextString().charAt(0);
        }
    }

    private void debug(Object... o) {
        if (ONLINE_JUDGE) {
            return;
        }
        System.out.println(Arrays.deepToString(o));
    }

    public static void main(String args[]) throws IOException {
        new GridGame();
    }
}


//package year2019.month01.cf.round534;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class GridGame {

    boolean ONLINE_JUDGE = (System.getProperty("ONLINE_JUDGE") != null);

    public GridGame() throws IOException {
        InputReader in;
        if (ONLINE_JUDGE) {
            in = new InputReader(System.in);
        } else {
            in = new InputReader(new FileInputStream("/Users/karj/Competitive Programming/input.txt"));
        }
        PrintWriter out = new PrintWriter(System.out);

        int T = 1;
        for (int caseNo = 1; caseNo <= T; caseNo++) {
            solve(caseNo, in, out);
        }

        out.close();
    }

    private void solve(int caseNo, InputReader in, PrintWriter out) throws IOException {
        char s[] = in.nextString().toCharArray();
        int grid[][] = new int[4][4];
        int row[] = new int[s.length];
        int col[] = new int[s.length];
        int cr[] = new int[4];
        int cc[] = new int[4];
        for (int i = 0; i < s.length; i++) {
            Arrays.fill(cr, 0);
            Arrays.fill(cc, 0);
            if (s[i] == '0') {
                outerr:
                for (int r = 0; r < 3; r++) {
                    for (int c = 0; c < 4; c++) {
                        if (grid[r][c] == 0 && grid[r + 1][c] == 0) {
                            row[i] = r + 1;
                            col[i] = c + 1;
                            grid[r][c] = 1;
                            grid[r + 1][c] = 1;
                            break outerr;
                        }
                    }
                }
            } else {
                outerc:
                for (int r = 0; r < 4; r++) {
                    for (int c = 0; c < 3; c++) {
                        if (grid[r][c] == 0 && grid[r][c + 1] == 0) {
                            row[i] = r + 1;
                            col[i] = c + 1;
                            grid[r][c] = 1;
                            grid[r][c + 1] = 1;
                            break outerc;
                        }
                    }
                }
            }
            debug(s[i]);
            for (int rrr[] : grid) debug(rrr);
            for (int r = 0; r < 4; r++) {
                int allFull = 1;
                for (int c = 0; c < 4; c++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cr[r] = 1;
                }
            }
            for (int c = 0; c < 4; c++) {
                int allFull = 1;
                for (int r = 0; r < 4; r++) {
                    if (grid[r][c] == 0) {
                        allFull = 0;
                        break;
                    }
                }
                if (allFull == 1) {
                    cr[c] = 1;
                }
            }
            for (int r = 0; r < 4; r++) {
                if (cr[r] == 1) {
                    for (int c = 0; c < 4; c++) {
                        grid[r][c] = 0;
                    }
                }
            }
            for (int c = 0; c < 4; c++) {
                if (cc[c] == 1) {
                    for (int r = 0; r < 4; r++) {
                        grid[r][c] = 0;
                    }
                }
            }
            debug(s[i]);
            for (int rrr[] : grid) debug(rrr);
        }
        for (int i = 0; i < s.length; i++) {
            out.println(row[i] + " " + col[i]);
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

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

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

        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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }

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

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

        public int nextInteger() {
            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 Long nextLong() {
            return Long.parseLong(nextString());
        }

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

        public char nextCharacter() {
            return nextString().charAt(0);
        }
    }

    private void debug(Object... o) {
        if (ONLINE_JUDGE) {
            return;
        }
        System.out.println(Arrays.deepToString(o));
    }

    public static void main(String args[]) throws IOException {
        new GridGame();
    }
}


import java.util.*;
public class Solution {
    static int n,t=1;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //t=scanner.nextInt();
        while (t-->0) {
            int x=0,y=1,z;
            String string = scanner.next();
            n=string.length();
            for(int i=0;i<n;i++) {
                if(string.charAt(i)=='0') {
                    x++;
                    if(x>4)
                        x=0;
                    System.out.println(x+" "+1);
                }
                else {
                    if(y>4)
                        y=1;
                    System.out.println(3+" "+y);
                    y+=2;

                }
            }
        }

    }

}


import java.util.*;
public class Solution {
    static int n,t=1;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //t=scanner.nextInt();
        while (t-->0) {
            int x=0,y=1,z;
            String string = scanner.next();
            n=string.length();
            for(int i=0;i<n;i++) {
                if(string.charAt(i)=='0') {
                    x++;
                    if(x>4)
                        x=1;
                    System.out.println(1+" "+x);
                }
                else {
                    if(y>4)
                        y=1;
                    System.out.println(3+" "+y);
                    y+=2;

                }
            }
        }

    }

}


import java.util.*;
public class Solution {
    static int n,t=1;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //t=scanner.nextInt();
        while (t-->0) {
            int x=0,y=1,z;
            String string = scanner.next();
            n=string.length();
            for(int i=0;i<n;i++) {
                if(string.charAt(i)=='0') {
                    x++;
                    if(x>4)
                        x=0;
                    System.out.println(1+" "+x);
                }
                else {
                    if(y>4)
                        y=1;
                    System.out.println(3+" "+y);
                    y+=2;

                }
            }
        }

    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CGridGame solver = new CGridGame();
        solver.solve(1, in, out);
        out.close();
    }

    static class CGridGame {
        boolean[][] matrix;

        public void doIt() {
            boolean[] row = new boolean[4];
            boolean[] column = new boolean[4];
            Arrays.fill(row, true);
            Arrays.fill(column, true);
            for (int i = 0; i < 4; i++) {
                for (int j = 0; j < 4; j++) {
                    if (!matrix[i][j]) {
                        row[i] = false;
                        column[j] = false;
                    }
                }
            }
            for (int i = 0; i < 4; i++) {
                if (row[i]) {
                    for (int j = 0; j < 4; j++) matrix[i][j] = false;
                }
            }
            for (int i = 0; i < 4; i++) {
                if (column[i]) {
                    for (int j = 0; j < 4; j++) matrix[j][i] = false;
                }
            }
        }

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            char[] ar = in.scanString().toCharArray();
            matrix = new boolean[4][4];
            int tt = 0;
            for (char c : ar) {
                if (c == '0') {
                    if (matrix[0][0]) {
                        matrix[2][0] = true;
                        matrix[3][0] = true;
                        out.println(3 + " " + 1);
                        tt++;
                    } else {
                        matrix[0][0] = true;
                        matrix[1][0] = true;
                        out.println(1 + " " + 1);
                        tt++;
                    }
                } else {
                    for (int i = 0; i < 4; i++) {
                        if (!matrix[i][1]) {
                            matrix[i][1] = true;
                            matrix[i][2] = true;
                            out.println((i + 1) + " " + 2);
                            tt++;
                            break;
                        }
                    }
                }
                doIt();
            }
            if (tt != ar.length) throw new RuntimeException();

        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public String scanString() {
            int c = scan();
            if (c == -1) return null;
            while (isWhiteSpace(c)) c = scan();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = scan();
            } while (!isWhiteSpace(c));
            return res.toString();
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.Random;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CGridGame solver = new CGridGame();
        solver.solve(1, in, out);
        out.close();
    }

    static class CGridGame {
        boolean[][] matrix;

        public void doIt() {
            boolean[] row = new boolean[4];
            boolean[] column = new boolean[4];
            Arrays.fill(row, true);
            Arrays.fill(column, true);
            for (int i = 0; i < 4; i++) {
                for (int j = 0; j < 4; j++) {
                    if (!matrix[i][j]) {
                        row[i] = false;
                        column[j] = false;
                    }
                }
            }
            for (int i = 0; i < 4; i++) {
                if (row[i]) {
                    for (int j = 0; j < 4; j++) matrix[i][j] = false;
                }
            }
            for (int i = 0; i < 4; i++) {
                if (column[i]) {
                    for (int j = 0; j < 4; j++) matrix[j][i] = false;
                }
            }
        }

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            char[] ar = in.scanString().toCharArray();
            Random rd = new Random(new Random().nextInt() * 2 * new Random().nextLong());
            boolean done = false;
            LOL:
            while (true) {
                matrix = new boolean[4][4];
                StringBuilder res = new StringBuilder();
                for (int c : ar) {
                    if (c == '0') {
                        boolean flag = false;
                        int[] temp = new int[]{0, 1, 2};

                        if (done) for (int i = 0; i < 10; i++) {
                            int index1 = rd.nextInt(3);
                            int index2 = rd.nextInt(3);
                            temp[index1] = temp[index1] + temp[index2] - (temp[index2] = temp[index1]);
                        }
                        out:
                        for (int i = 0; i < 3; i++) {
                            for (int j = 0; j < 4; j++) {
                                if (!matrix[temp[i]][j] && !matrix[temp[i] + 1][j]) {
                                    flag = true;
                                    matrix[temp[i]][j] = true;
                                    matrix[temp[i] + 1][j] = true;
                                    res.append((temp[i] + 1) + " " + (j + 1) + "\n");
                                    break out;
                                }
                            }
                        }
                        if (!flag) {
                            done = true;
                            continue LOL;
                        }

                    } else {
                        boolean flag = false;
                        int[] temp = new int[]{0, 1, 2};

                        if (done) for (int i = 0; i < 10; i++) {
                            int index1 = rd.nextInt(3);
                            int index2 = rd.nextInt(3);
                            temp[index1] = temp[index1] + temp[index2] - (temp[index2] = temp[index1]);
                        }
                        out:
                        for (int i = 0; i < 3; i++) {
                            for (int j = 0; j < 4; j++) {
                                if (!matrix[j][temp[i]] && !matrix[j][temp[i] + 1]) {
                                    flag = true;
                                    matrix[j][temp[i]] = true;
                                    matrix[j][temp[i] + 1] = true;
                                    res.append((j + 1) + " " + (temp[i] + 1) + "\n");
                                    break out;
                                }
                            }
                        }
                        if (!flag) {
                            done = true;
                            continue LOL;
                        }
                    }
                    doIt();
                }
                out.println(res);
                break LOL;
            }

        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public String scanString() {
            int c = scan();
            if (c == -1) return null;
            while (isWhiteSpace(c)) c = scan();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = scan();
            } while (!isWhiteSpace(c));
            return res.toString();
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.Random;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CGridGame solver = new CGridGame();
        solver.solve(1, in, out);
        out.close();
    }

    static class CGridGame {
        boolean[][] matrix;

        public void doIt() {
            boolean[] row = new boolean[4];
            boolean[] column = new boolean[4];
            Arrays.fill(row, true);
            Arrays.fill(column, true);
            for (int i = 0; i < 4; i++) {
                for (int j = 0; j < 4; j++) {
                    if (!matrix[i][j]) {
                        row[i] = false;
                        column[j] = false;
                    }
                }
            }
            for (int i = 0; i < 4; i++) {
                if (row[i]) {
                    for (int j = 0; j < 4; j++) matrix[i][j] = false;
                }
            }
            for (int i = 0; i < 4; i++) {
                if (column[i]) {
                    for (int j = 0; j < 4; j++) matrix[j][i] = false;
                }
            }
        }

        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            char[] ar = in.scanString().toCharArray();
            Random rd = new Random(new Random().nextInt() * new Random().nextLong());
            LOL:
            while (true) {
                matrix = new boolean[4][4];
                StringBuilder res = new StringBuilder();
                for (int c : ar) {
                    if (c == '0') {
                        boolean flag = false;
                        int[] temp = new int[]{0, 1, 2};

                        for (int i = 0; i < 10; i++) {
                            int index1 = rd.nextInt(3);
                            int index2 = rd.nextInt(3);
                            temp[index1] = temp[index1] + temp[index2] - (temp[index2] = temp[index1]);
                        }
                        out:
                        for (int i = 0; i < 3; i++) {
                            for (int j = 0; j < 4; j++) {
                                if (!matrix[temp[i]][j] && !matrix[temp[i] + 1][j]) {
                                    flag = true;
                                    matrix[temp[i]][j] = true;
                                    matrix[temp[i] + 1][j] = true;
                                    res.append((temp[i] + 1) + " " + (j + 1) + "\n");
                                    break out;
                                }
                            }
                        }
                        if (!flag) continue LOL;

                    } else {
                        boolean flag = false;
                        int[] temp = new int[]{0, 1, 2};

                        for (int i = 0; i < 10; i++) {
                            int index1 = rd.nextInt(3);
                            int index2 = rd.nextInt(3);
                            temp[index1] = temp[index1] + temp[index2] - (temp[index2] = temp[index1]);
                        }
                        out:
                        for (int i = 0; i < 3; i++) {
                            for (int j = 0; j < 4; j++) {
                                if (!matrix[j][temp[i]] && !matrix[j][temp[i] + 1]) {
                                    flag = true;
                                    matrix[j][temp[i]] = true;
                                    matrix[j][temp[i] + 1] = true;
                                    res.append((j + 1) + " " + (temp[i] + 1) + "\n");
                                    break out;
                                }
                            }
                        }
                        if (!flag) continue LOL;
                    }
                    doIt();
                }
                out.println(res);
                break LOL;
            }

        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public String scanString() {
            int c = scan();
            if (c == -1) return null;
            while (isWhiteSpace(c)) c = scan();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = scan();
            } while (!isWhiteSpace(c));
            return res.toString();
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}