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

public class SolverC {

    StringTokenizer stok;
    BufferedReader br;
    PrintWriter pw;

    String nextToken() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            stok = new StringTokenizer(br.readLine());
        }
        return stok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private void run() throws IOException {
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        solve();
        pw.flush();
        pw.close();
    }

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

    private void solve() throws IOException {
        String str = nextToken();
        int len = str.length();
        int count0 = 0;
        int count1 = 0;
        for (int i=0; i<len; i++) {
            if (str.charAt(i) == '0') {
                count0 = (count0 + 1) % 4;
                pw.println((count0 + 1) + " 1");
            } else {
                count1 = (count1 + 2) % 4;
                pw.println((count1 + 1) + " 3");
            }
        }
    }
}


import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.regex.*;
public class Myclass{
         public static Queue a[]=new Queue[300001];

         public static void main(String[] args)
        {
            InputReader in = new InputReader(System.in);
            PrintWriter pw = new PrintWriter(System.out);
            char s[]=in.nextLine().toCharArray();

            boolean occ[][]=new boolean [5][5];
            for(int i=0;i<s.length;i++) {
            	if(s[i]=='0') {
            		for(int j=1;j<=4;j++) {
            			boolean chk=false;
            			for(int k=1;k<=3;k++) {
            				if(!occ[k][j] && !occ[k+1][j])
            				{
            					occ[k][j]=occ[k+1][j]=true;
            					chk=true;
            					pw.println(k+" "+j);
            					break;
            				}
            			}
            			if(chk)
            				break;
            		}
            	}
            	else
            	{
            		for(int j=1;j<=4;j++) {
            			boolean chk=false;
            			for(int k=1;k<=3;k++) {
            				if(!occ[j][k] && !occ[j][k+1])
            				{
            					occ[j][k]=occ[j][k+1]=true;
            					chk=true;
            					pw.println(j+" "+k);
            					break;
            				}
            			}
            			if(chk)
            				break;
            		}
            	}
            	for(int j=1;j<=4;j++) {
            		boolean chk=true;
            		for(int k=1;k<=4;k++) {
            			if(!occ[j][k])
            				chk=false;
            		}
            		if(chk==true) {
            			for(int k=1;k<=4;k++) occ[j][k]=false;
            		}
            	}
            	for(int j=1;j<=4;j++) {
            		boolean chk=true;
            		for(int k=1;k<=4;k++) {
            			if(!occ[k][j])
            				chk=false;
            		}
            		if(chk==true) {
            			for(int k=1;k<=4;k++) occ[k][j]=false;
            		}
            	}

            }

            pw.flush();
            pw.close();

        }

		private static void debug(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
        static class InputReader
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }
        public int snext()
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars)
            {
                curChar = 0;
                try
                {
                    snumChars = stream.read(buf);
                }

                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

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

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

        public int[] nextIntArray(int n)
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = nextInt();
            }
            return a;
        }
        static class tri implements Comparable<tri> {
            int p, c, l;

            tri(int p, int c, int l) {
                this.p = p;
                this.c = c;
                this.l = l;
            }

            public int compareTo(tri o) {
                return Integer.compare(l, o.l);
            }
        }

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

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

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;

        public static int[] suffle(int[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                int temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }

        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }

       /* public static long primeFactorization(long n)
        {
             HashSet<Integer> a =new HashSet<Integer>();
        	long cnt=0;
            for(int i=2;i*i<=n;i++)
            {
                while(a%i==0)
                {
                    a.add(i);
                    a/=i;
                }
            }
            if(a!=1)
            	cnt++;
                //a.add(n);
            return cnt;
        }*/

        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;

            isPrime[0] = false;
            isPrime[1] = false;

            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }

        public static int GCD(int a,int b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }

        public static long GCD(long a,long b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }

        public static void extendedEuclid(int A,int B)
        {
            if(B==0)
            {
                d = A;
                p = 1 ;
                q = 0;
            }
            else
            {
                extendedEuclid(B, A%B);
                int temp = p;
                p = q;
                q = temp - (A/B)*q;
            }
        }

        public static long LCM(long a,long b)
        {
            return (a*b)/GCD(a,b);
        }

        public static int LCM(int a,int b)
        {
            return (a*b)/GCD(a,b);
        }

        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }

        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }

        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static boolean isPrime(int n)
        {

            if (n <= 1)  return false;
            if (n <= 3)  return true;

            if (n%2 == 0 || n%3 == 0)
                return false;

            for (int i=5; i*i<=n; i=i+6)
            {
                if (n%i == 0 || n%(i+2) == 0)
                   return false;
            }

            return true;
        }

         public static long[] shuffle(long[] a, Random gen){
                for(int i = 0, n = a.length;i < n;i++){
                    int ind = gen.nextInt(n-i)+i;
                    long d = a[i];
                    a[i] = a[ind];
                    a[ind] = d;
                }
                return a;
            }
        static class pair implements Comparable<pair>
        {
            Long x;
            Integer y;
            pair(long z,int sum)
            {
                this.x=z;
                this.y=sum;
            }

        public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);

            return result;
            }

            public String toString()
            {
                return x+" "+y;
            }

            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }

            public int hashCode()
            {
                return new Long(x).hashCode()*31 + new Long(y).hashCode();
            }
        }

}
class query {
	Integer x;
	Integer y,z;
	query(int x,int y,int z){
		this.x=x;
		this.y=y;
		this.z=z;
	}
	 public String toString()
     {
         return x+" "+y+" "+z;
     }
}


import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.regex.*;
public class Myclass{
         public static Queue a[]=new Queue[300001];

         public static void main(String[] args)
        {
            InputReader in = new InputReader(System.in);
            PrintWriter pw = new PrintWriter(System.out);
            char s[]=in.nextLine().toCharArray();
            Vector<pair>v=new Vector();

            boolean occ[][]=new boolean [5][5];
            for(int i=0;i<s.length;i++) {
            	if(s[i]=='0') {
            		for(int j=1;j<=3;j++) {
            			boolean chk=false;
            			for(int k=1;k<=4;k++) {
            				if(!occ[j][k] && !occ[j+1][k])
            				{
            					occ[j][k]=occ[j+1][k]=true;
            					chk=true;
            					pw.println(j+" "+k);
            					break;
            				}
            			}
            			if(chk)
            				break;
            		}
            	}
            	else
            	{
            		for(int j=1;j<=4;j++) {
            			boolean chk=false;
            			for(int k=1;k<=3;k++) {
            				if(!occ[j][k] && !occ[j][k+1])
            				{
            					occ[j][k]=occ[j][k+1]=true;
            					chk=true;
            					pw.println(j+" "+k);
            					break;
            				}
            			}
            			if(chk)
            				break;
            		}
            	}
            	for(int j=1;j<=4;j++) {
            		boolean chk=true;
            		for(int k=1;k<=4;k++) {
            			if(!occ[j][k])
            				chk=false;
            		}
            		if(chk==true) {
            			for(int k=1;k<=4;k++) occ[j][k]=false;
            		}
            	}
            	for(int j=1;j<=4;j++) {
            		boolean chk=true;
            		for(int k=1;k<=4;k++) {
            			if(!occ[k][j])
            				chk=false;
            		}
            		if(chk==true) {
            			for(int k=1;k<=4;k++) occ[k][j]=false;
            		}
            	}
            }

            pw.flush();
            pw.close();

        }

		private static void debug(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
        static class InputReader
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }
        public int snext()
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars)
            {
                curChar = 0;
                try
                {
                    snumChars = stream.read(buf);
                }

                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

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

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

        public int[] nextIntArray(int n)
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = nextInt();
            }
            return a;
        }
        static class tri implements Comparable<tri> {
            int p, c, l;

            tri(int p, int c, int l) {
                this.p = p;
                this.c = c;
                this.l = l;
            }

            public int compareTo(tri o) {
                return Integer.compare(l, o.l);
            }
        }

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

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

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;

        public static int[] suffle(int[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                int temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }

        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }

       /* public static long primeFactorization(long n)
        {
             HashSet<Integer> a =new HashSet<Integer>();
        	long cnt=0;
            for(int i=2;i*i<=n;i++)
            {
                while(a%i==0)
                {
                    a.add(i);
                    a/=i;
                }
            }
            if(a!=1)
            	cnt++;
                //a.add(n);
            return cnt;
        }*/

        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;

            isPrime[0] = false;
            isPrime[1] = false;

            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }

        public static int GCD(int a,int b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }

        public static long GCD(long a,long b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }

        public static void extendedEuclid(int A,int B)
        {
            if(B==0)
            {
                d = A;
                p = 1 ;
                q = 0;
            }
            else
            {
                extendedEuclid(B, A%B);
                int temp = p;
                p = q;
                q = temp - (A/B)*q;
            }
        }

        public static long LCM(long a,long b)
        {
            return (a*b)/GCD(a,b);
        }

        public static int LCM(int a,int b)
        {
            return (a*b)/GCD(a,b);
        }

        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }

        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }

        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static boolean isPrime(int n)
        {

            if (n <= 1)  return false;
            if (n <= 3)  return true;

            if (n%2 == 0 || n%3 == 0)
                return false;

            for (int i=5; i*i<=n; i=i+6)
            {
                if (n%i == 0 || n%(i+2) == 0)
                   return false;
            }

            return true;
        }

         public static long[] shuffle(long[] a, Random gen){
                for(int i = 0, n = a.length;i < n;i++){
                    int ind = gen.nextInt(n-i)+i;
                    long d = a[i];
                    a[i] = a[ind];
                    a[ind] = d;
                }
                return a;
            }
        static class pair implements Comparable<pair>
        {
            Long x;
            Integer y;
            pair(long z,int sum)
            {
                this.x=z;
                this.y=sum;
            }

        public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);

            return result;
            }

            public String toString()
            {
                return x+" "+y;
            }

            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }

            public int hashCode()
            {
                return new Long(x).hashCode()*31 + new Long(y).hashCode();
            }
        }

}
class query {
	Integer x;
	Integer y,z;
	query(int x,int y,int z){
		this.x=x;
		this.y=y;
		this.z=z;
	}
	 public String toString()
     {
         return x+" "+y+" "+z;
     }
}


import java.util.*;
public class JavaApplication7 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        int h=0,v=0;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)=='0'){
                v++;
                if(v%2==0)
                    System.out.println("1 4");
                else
                    System.out.println("3 4");
            }
            else{
                h++;
                if(h%2==0)
                    System.out.println("1 1");
                else
                    System.out.println("1 3");
            }
        }
    }

}


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

}


import java.util.*;
public class JavaApplication7 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        int h=0,v=0;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)=='0'){
                v++;
                if(v%2==0)
                    System.out.println("1 4");
                else
                    System.out.println("3 4");
            }
            else{
                h++;
                if(h%2==0)
                    System.out.println("1 3");
                else
                    System.out.println("1 1");
            }
        }
    }

}


import java.util.*;
public class JavaApplication7 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        int h=0,v=0;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)=='0'){
                v++;
                if(v%2==0)
                    System.out.println("3 4");
                else
                    System.out.println("1 4");
            }
            else{
                h++;
                if(h%2==0)
                    System.out.println("1 1");
                else
                    System.out.println("1 3");
            }
        }
    }

}


import java.util.*;
import java.io.*;
import java.lang.reflect.Array;

		public class codeforces
		{
			public static void main(String[] args)
			{
				InputReader in = new InputReader(System.in);
				PrintWriter pw = new PrintWriter(System.out);

				String s = in.nextLine();
				int[][] grid = new int[4][4];
				ArrayList<Integer> r = new ArrayList<>();
				ArrayList<Integer> c = new ArrayList<>();
				boolean flag = false;

				for(int i=0;i<s.length();i++)
				{
					if(s.charAt(i) == '0')
					{
						for(int j=0;j<4;j++)
						{
							for(int k=0;k<3;k++)
							{
								if(grid[k][j] == 0 && grid[k+1][j] == 0)
								{
									grid[k][j] = 1;
									grid[k+1][j] = 1;
									pw.println(k+1+" "+(j+1));
									flag = true;
									break;
								}
							}

							if(flag)
							{
								flag = false;
								break;
							}
						}
					}
					else
					{
						for(int j=0;j<4;j++)
						{
							for(int k=0;k<3;k++)
							{
								if(grid[j][k] == 0 && grid[j][k+1] == 0)
								{
									grid[j][k] = 1;
									grid[j][k+1] = 1;
									pw.println(j+1+" "+(k+1));
									flag = true;
									break;
								}
							}

							if(flag)
							{
								flag = false;
								break;
							}
						}
					}

					for(int j=0;j<4;j++)
					{
						int ans = 1;

						for(int k=0;k<4;k++)
							ans = ans*grid[j][k];

						if(ans == 1)
							r.add(j);

						ans = 1;

						for(int k=0;k<4;k++)
							ans = ans*grid[k][j];

						if(ans == 1)
							c.add(j);
					}

					for(int row : r)
					{
						for(int j=0;j<4;j++)
							grid[row][j] = 0;
					}

					for(int column : c)
					{
						for(int j=0;j<4;j++)
							grid[j][column] = 0;
					}
				}

				pw.flush();
				pw.close();
			}

			public static long fact(long n, long M)
			{
				long ans = 1;

				for(long i=n;i>0;i--)
				{
					ans = (ans*i)%M;
				}

				return ans;
			}

		/*	public static void DFS(int sourse)
			{
				int count = 0;
				visited[sourse] = true;

				for(int u : adj[sourse])
				{
					if(!visited[u])
					{
						DFS(u);
					}
				}

			}*/

			public static ArrayList Divisors(long n)
			{
			    ArrayList<Long> div = new ArrayList<>();

			    for (long i=1; i<=Math.sqrt(n); i++)
			    {
			        if (n%i == 0)
			        {
			        	div.add(i);

			            if(n/i != i)
			            	div.add(n/i);
			        }
			    }
			    return div;
			}

			public static int BinarySearch(long[] a, long k)
			{
				int n = a.length;
				int i = 0, j = n-1;
				int mid = 0;

				if(k < a[0])
					return 0;
				else if(k >= a[n-1])
					return n;
				else
				{
					while(j - i > 1)
					{
						mid = (i+j)/2;

						if(k >= a[mid])
							i = mid;
						else
							j = mid;
					}
				}

				return i+1;
			}
			public static long GCD(long a,long b)
			{
				if(b==0)
					return a;
				else
					return GCD(b,a%b);
			}

			public static long LCM(long a,long b)
			{
				return (a*b)/GCD(a, b);
			}

			static class pair implements Comparable<pair>
			{
				Integer x, y;
				pair(int x,int y)
				{
					this.x=x;
					this.y=y;
				}

				public int compareTo(pair o) {
					int result = x.compareTo(o.x);
					if(result==0)
						result = y.compareTo(o.y);

					return result;
				}

				public String toString()
				{
					return x+" "+y;
				}

				public boolean equals(Object o)
				{
					if (o instanceof pair)
				    {
						pair p = (pair)o;
						return p.x - x == 0 && p.y - y == 0 ;
					}
					return false;
				}

				public int hashCode()
				{
					return new Long(x).hashCode()*31 + new Long(y).hashCode();
				}
			}

			static class InputReader
			{

				private final InputStream stream;
				private final byte[] buf = new byte[8192];
				private int curChar, snumChars;
				private SpaceCharFilter filter;

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

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

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

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

				public int[] nextIntArray(int n)
				{
					int a[] = new int[n];
					for (int i = 0; i < n; i++)
					{
						a[i] = nextInt();
					}
					return a;
				}

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

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

				public boolean isSpaceChar(int c)
				{
					if (filter != null)
						return filter.isSpaceChar(c);
					return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
				}

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

				public interface SpaceCharFilter
			    {
					public boolean isSpaceChar(int ch);
				}
			}

			static class CodeX {
	        public static void sort(long arr[]) {
	            merge_sort(arr, 0, arr.length - 1);
	        }

	        private static void merge_sort(long A[], long start, long end) {
	            if (start < end) {
	                long mid = (start + end) / 2;
	                merge_sort(A, start, mid);
	                merge_sort(A, mid + 1, end);
	                merge(A, start, mid, end);
	            }

	        }

	        private static void merge(long A[], long start,long mid, long end) {
	            long p = start, q = mid + 1;
	            long Arr[] = new long[(int)(end - start + 1)];
	            long k = 0;

	            for (int i = (int)start; i <= end; i++) {
	                if (p > mid)
	                    Arr[(int)k++] = A[(int)q++];

	                else if (q > end)
	                    Arr[(int)k++] = A[(int)p++];

	                else if (A[(int)p] < A[(int)q])
	                    Arr[(int)k++] = A[(int)p++];

	                else
	                    Arr[(int)k++] = A[(int)q++];
	            }
	            for (int i = 0; i < k; i++) {
	                A[(int)start++] = Arr[i];
	            }

	        }

	    }
		}


import java.util.*;
import java.io.*;
import java.lang.reflect.Array;

		public class codeforces
		{
			public static void main(String[] args)
			{
				InputReader in = new InputReader(System.in);
				PrintWriter pw = new PrintWriter(System.out);

				String s = in.nextLine();
				int[][] grid = new int[4][4];
				boolean flag = false;

				for(int i=0;i<s.length();i++)
				{
					ArrayList<Integer> r = new ArrayList<>();
					ArrayList<Integer> c = new ArrayList<>();

					if(s.charAt(i) == '0')
					{
						for(int j=0;j<4;j++)
						{
							for(int k=0;k<3;k++)
							{
								if(grid[k][j] == 0 && grid[k+1][j] == 0)
								{
									grid[k][j] = 1;
									grid[k+1][j] = 1;
									pw.println(k+1+" "+(j+1));
									flag = true;
									break;
								}
							}

							if(flag)
							{
								flag = false;
								break;
							}
						}
					}
					else
					{
						for(int j=0;j<4;j++)
						{
							for(int k=0;k<3;k++)
							{
								if(grid[j][k] == 0 && grid[j][k+1] == 0)
								{
									grid[j][k] = 1;
									grid[j][k+1] = 1;
									pw.println(j+1+" "+(k+1));
									flag = true;
									break;
								}
							}

							if(flag)
							{
								flag = false;
								break;
							}
						}
					}

					for(int j=0;j<4;j++)
					{
						int ans = 1;

						for(int k=0;k<4;k++)
							ans = ans*grid[j][k];

						if(ans == 1)
							r.add(j);

						ans = 1;

						for(int k=0;k<4;k++)
							ans = ans*grid[k][j];

						if(ans == 1)
							c.add(j);
					}

					for(int row : r)
					{
						for(int j=0;j<4;j++)
							grid[row][j] = 0;
					}

					for(int column : c)
					{
						for(int j=0;j<4;j++)
							grid[j][column] = 0;
					}
				}

				pw.flush();
				pw.close();
			}

			public static long fact(long n, long M)
			{
				long ans = 1;

				for(long i=n;i>0;i--)
				{
					ans = (ans*i)%M;
				}

				return ans;
			}

		/*	public static void DFS(int sourse)
			{
				int count = 0;
				visited[sourse] = true;

				for(int u : adj[sourse])
				{
					if(!visited[u])
					{
						DFS(u);
					}
				}

			}*/

			public static ArrayList Divisors(long n)
			{
			    ArrayList<Long> div = new ArrayList<>();

			    for (long i=1; i<=Math.sqrt(n); i++)
			    {
			        if (n%i == 0)
			        {
			        	div.add(i);

			            if(n/i != i)
			            	div.add(n/i);
			        }
			    }
			    return div;
			}

			public static int BinarySearch(long[] a, long k)
			{
				int n = a.length;
				int i = 0, j = n-1;
				int mid = 0;

				if(k < a[0])
					return 0;
				else if(k >= a[n-1])
					return n;
				else
				{
					while(j - i > 1)
					{
						mid = (i+j)/2;

						if(k >= a[mid])
							i = mid;
						else
							j = mid;
					}
				}

				return i+1;
			}
			public static long GCD(long a,long b)
			{
				if(b==0)
					return a;
				else
					return GCD(b,a%b);
			}

			public static long LCM(long a,long b)
			{
				return (a*b)/GCD(a, b);
			}

			static class pair implements Comparable<pair>
			{
				Integer x, y;
				pair(int x,int y)
				{
					this.x=x;
					this.y=y;
				}

				public int compareTo(pair o) {
					int result = x.compareTo(o.x);
					if(result==0)
						result = y.compareTo(o.y);

					return result;
				}

				public String toString()
				{
					return x+" "+y;
				}

				public boolean equals(Object o)
				{
					if (o instanceof pair)
				    {
						pair p = (pair)o;
						return p.x - x == 0 && p.y - y == 0 ;
					}
					return false;
				}

				public int hashCode()
				{
					return new Long(x).hashCode()*31 + new Long(y).hashCode();
				}
			}

			static class InputReader
			{

				private final InputStream stream;
				private final byte[] buf = new byte[8192];
				private int curChar, snumChars;
				private SpaceCharFilter filter;

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

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

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

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

				public int[] nextIntArray(int n)
				{
					int a[] = new int[n];
					for (int i = 0; i < n; i++)
					{
						a[i] = nextInt();
					}
					return a;
				}

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

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

				public boolean isSpaceChar(int c)
				{
					if (filter != null)
						return filter.isSpaceChar(c);
					return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
				}

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

				public interface SpaceCharFilter
			    {
					public boolean isSpaceChar(int ch);
				}
			}

			static class CodeX {
	        public static void sort(long arr[]) {
	            merge_sort(arr, 0, arr.length - 1);
	        }

	        private static void merge_sort(long A[], long start, long end) {
	            if (start < end) {
	                long mid = (start + end) / 2;
	                merge_sort(A, start, mid);
	                merge_sort(A, mid + 1, end);
	                merge(A, start, mid, end);
	            }

	        }

	        private static void merge(long A[], long start,long mid, long end) {
	            long p = start, q = mid + 1;
	            long Arr[] = new long[(int)(end - start + 1)];
	            long k = 0;

	            for (int i = (int)start; i <= end; i++) {
	                if (p > mid)
	                    Arr[(int)k++] = A[(int)q++];

	                else if (q > end)
	                    Arr[(int)k++] = A[(int)p++];

	                else if (A[(int)p] < A[(int)q])
	                    Arr[(int)k++] = A[(int)p++];

	                else
	                    Arr[(int)k++] = A[(int)q++];
	            }
	            for (int i = 0; i < k; i++) {
	                A[(int)start++] = Arr[i];
	            }

	        }

	    }
		}


// For you A THOUSAND TIMES OVER.//
// Author :- Saurabh//
//BIT MESRA, RANCHI//
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class gridGame {
    static int grid[][] = new int[4][4];

    static void Bolo_Jai_Mata_Di() {

        char ch[] = (ns() + "t").toCharArray();
        n = ch.length;

        tsc();

        for (int i = 0; i < n - 1; i++) {
            fill(ch[i]);
            clear(ch[i + 1]);
        }

        tec();                  //calculates the ending time of execution
        //pwt();                //prints the time taken to execute the program

        flush();
    }

    static void fill(char ch) {
        if (ch == '0')
            vertical();
        else horizontal();
    }

    static void horizontal() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                if (grid[i][j] + grid[i][j + 1] == 0) {
                    pl((i + 1) + " " + (j + 1));
                    grid[i][j] = grid[i][j + 1] = 1;
                    return;
                }
            }
        }
    }

    static void vertical() {
        for (int j = 0; j < 4; j++) {
            for (int i = 0; i < 3; i++) {
                if (grid[i][j] + grid[i + 1][j] == 0) {
                    pl((i + 1) + " " + (j + 1));
                    grid[i][j] = grid[i + 1][j] = 1;
                    return;
                }
            }
        }

    }

    static void clear(char ch) {
        if (ch == '0') {
            clearv();
            clearh();
        } else {
            clearh();
            clearv();
        }
    }

    static void clearh() {
        for (int i = 0; i < 4; i++) {
            if (grid[i][0] + grid[i][1] + grid[i][2] + grid[i][3] == 4)
                grid[i][0] = grid[i][1] = grid[i][2] = grid[i][3] = 0;
        }
    }

    static void clearv() {
        for (int j = 0; j < 4; j++) {
            if (grid[0][j] + grid[1][j] + grid[2][j] + grid[3][j] == 4)
                grid[0][j] = grid[1][j] = grid[2][j] = grid[3][j] = 0;
        }
    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    static Calendar ts, te;                                                  //For time calculation
    static int mod9 = 1000000007;
    static int n, m, t, mod = 998244353;
    static Lelo input = new Lelo(System.in);
    static PrintWriter pw = new PrintWriter(System.out, true);

    public static void main(String[] args) {                                 //threading has been used to increase the stack size.

        new Thread(null, null, "BlackRise", 1 << 25)  //the last parameter is stack size which is desired,
        {
            public void run() {

                try {
                    Bolo_Jai_Mata_Di();
                } catch (Exception e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }

    static class Lelo {                                              //Lelo class for fast input
        private InputStream ayega;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public Lelo(InputStream ayega) {
            this.ayega = ayega;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = ayega.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public int nextInt() {
            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() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int 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 double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    // functions to take input//
    static int ni() {
        return input.nextInt();
    }

    static long nl() {
        return input.nextLong();
    }

    static double nd() {
        return input.nextDouble();
    }

    static String ns() {
        return input.readString();
    }

    //functions to give output
    static void pl() {
        pw.println();
    }

    static void p(Object o) {
        pw.print(o + " ");
    }

    static void pws(Object o) {
        pw.print(o + "");
    }

    static void pl(Object o) {
        pw.println(o);
    }

    static void tsc()                                          //calculates the starting time of execution
    {
        ts = Calendar.getInstance();
        ts.setTime(new Date());
    }

    static void tec()                                          //calculates the ending time of execution
    {
        te = Calendar.getInstance();
        te.setTime(new Date());
    }

    static void pwt()                                          //prints the time taken for execution
    {
        pw.printf("\nExecution time was :- %f s\n", (te.getTimeInMillis() - ts.getTimeInMillis()) / 1000.00);
    }

    static void flush() {
        pw.flush();
        pw.close();
    }

    static void sort(int ar[], int n) {
        for (int i = 0; i < n; i++) {
            int ran = (int) (Math.random() * n);
            int temp = ar[i];
            ar[i] = ar[ran];
            ar[ran] = temp;
        }
        Arrays.sort(ar);
    }

    static void sort(long ar[], int n) {
        for (int i = 0; i < n; i++) {
            int ran = (int) (Math.random() * n);
            long temp = ar[i];
            ar[i] = ar[ran];
            ar[ran] = temp;
        }
        Arrays.sort(ar);
    }

    static void sort(char ar[], int n) {
        for (int i = 0; i < n; i++) {
            int ran = (int) (Math.random() * n);
            char temp = ar[i];
            ar[i] = ar[ran];
            ar[ran] = temp;
        }
        Arrays.sort(ar);
    }
}


// For you A THOUSAND TIMES OVER.//
// Author :- Saurabh//
//BIT MESRA, RANCHI//
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class gridGame {
    static int grid[][]=new int[4][4];
    static void Bolo_Jai_Mata_Di() {

        char ch[] = (ns()+"t").toCharArray();
        n = ch.length;

        tsc();

        for (int i = 0; i < n-1; i++) {
            fill(ch[i]);
            clear(ch[i+1]);
        }

        tec();                  //calculates the ending time of execution
        //pwt();                //prints the time taken to execute the program

        flush();
    }

    static void fill(char ch)
    {
        if(ch=='0')
            vertical();
        else horizontal();
    }
    static void horizontal()
    {
        for(int i=0;i<4;i++)
        {
            for(int j=0;j<3;j++)
            {
                if(grid[i][j]+grid[i][j+1]==0)
                {
                    pl((i+1)+" "+(j+1));grid[i][j]=grid[i][j+1]=1;return;
                }
            }
        }
    }
    static void vertical()
    {
        for(int i=0;i<3;i++)
        {
            for(int j=0;j<4;j++)
            {
                if(grid[i][j]+grid[i+1][j]==0)
                {
                    pl((i+1)+" "+(j+1));grid[i][j]=grid[i+1][j]=1;return;
                }
            }
        }
    }

    static void clear(char ch)
    {
        if(ch=='0')
        {
            clearv();clearh();
        }
        else
        {
            clearh();clearv();
        }
    }

    static void clearh()
    {
        for(int i=0;i<4;i++)
        {
            if(grid[i][0]+grid[i][1]+grid[i][2]+grid[i][3]==4)grid[i][0]=grid[i][1]=grid[i][2]=grid[i][3]=0;
        }
    }
    static void clearv()
    {
        for(int j=0;j<4;j++)
        {
            if(grid[0][j]+grid[1][j]+grid[2][j]+grid[3][j]==4)grid[0][j]=grid[1][j]=grid[2][j]=grid[3][j]=0;
        }
    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    static Calendar ts, te;                                                  //For time calculation
    static int mod9 = 1000000007;
    static int n, m, t, mod = 998244353;
    static Lelo input = new Lelo(System.in);
    static PrintWriter pw = new PrintWriter(System.out, true);

    public static void main(String[] args) {                                 //threading has been used to increase the stack size.

        new Thread(null, null, "BlackRise", 1 << 25)  //the last parameter is stack size which is desired,
        {
            public void run() {

                try {
                    Bolo_Jai_Mata_Di();
                } catch (Exception e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }

    static class Lelo {                                              //Lelo class for fast input
        private InputStream ayega;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public Lelo(InputStream ayega) {
            this.ayega = ayega;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = ayega.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public int nextInt() {
            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() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int 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 double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            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 boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    // functions to take input//
    static int ni() {
        return input.nextInt();
    }

    static long nl() {
        return input.nextLong();
    }

    static double nd() {
        return input.nextDouble();
    }

    static String ns() {
        return input.readString();
    }

    //functions to give output
    static void pl() {
        pw.println();
    }

    static void p(Object o) {
        pw.print(o + " ");
    }

    static void pws(Object o) {
        pw.print(o + "");
    }

    static void pl(Object o) {
        pw.println(o);
    }

    static void tsc()                                          //calculates the starting time of execution
    {
        ts = Calendar.getInstance();
        ts.setTime(new Date());
    }

    static void tec()                                          //calculates the ending time of execution
    {
        te = Calendar.getInstance();
        te.setTime(new Date());
    }

    static void pwt()                                          //prints the time taken for execution
    {
        pw.printf("\nExecution time was :- %f s\n", (te.getTimeInMillis() - ts.getTimeInMillis()) / 1000.00);
    }

    static void flush() {
        pw.flush();
        pw.close();
    }

    static void sort(int ar[], int n) {
        for (int i = 0; i < n; i++) {
            int ran = (int) (Math.random() * n);
            int temp = ar[i];
            ar[i] = ar[ran];
            ar[ran] = temp;
        }
        Arrays.sort(ar);
    }

    static void sort(long ar[], int n) {
        for (int i = 0; i < n; i++) {
            int ran = (int) (Math.random() * n);
            long temp = ar[i];
            ar[i] = ar[ran];
            ar[ran] = temp;
        }
        Arrays.sort(ar);
    }

    static void sort(char ar[], int n) {
        for (int i = 0; i < n; i++) {
            int ran = (int) (Math.random() * n);
            char temp = ar[i];
            ar[i] = ar[ran];
            ar[ran] = temp;
        }
        Arrays.sort(ar);
    }
}


import static java.lang.System.out;

import java.util.*;

public class Test {

  Test() {
    Scanner in = new Scanner(System.in);
    String tiles = in.nextLine();
    List<List<Integer>> moves = new ArrayList<>();
    placeTiles(tiles, 0, 0, moves);
    for (int index = 0; index < moves.size(); index++) {
      out.println(moves.get(index).get(0) + " " + moves.get(index).get(1));
    }
  }

  boolean placeTiles(String tiles, int index, final int state, List<List<Integer>> moves) {
    if (index >= tiles.length()) {
      return true;
    }
    // 0 ver 1 hor
    int tileType = tiles.charAt(index) - '0';
    if (tileType == 0) {
      for (int row = 0; row < 3; row++) {
        for (int col = 0; col < 4; col++) {
          int bit1 = (row * 4) + col;
          int bit2 = ((row + 1) * 4) + col;
          if (!isTileEmpty(bit1, state) || !isTileEmpty(bit2, state)) {
            continue;
          }
          int newState = placeTile(state, bit1, bit2);
          moves.add(Arrays.asList(row + 1, col + 1));
          boolean hasAnswer = placeTiles(tiles, index + 1, newState, moves);
          if (hasAnswer) {
            return true;
          }
          moves.remove(moves.size() - 1);
        }
      }
    } else {
      for (int row = 0; row < 4; row++) {
        for (int col = 0; col < 3; col++) {
          int bit1 = (row * 4) + col;
          int bit2 = (row * 4) + col + 1;
          if (!isTileEmpty(bit1, state) || !isTileEmpty(bit2, state)) {
            continue;
          }
          int newState = placeTile(state, bit1, bit2);
          moves.add(Arrays.asList(row + 1, col + 1));
          boolean hasAnswer = placeTiles(tiles, index + 1, newState, moves);
          if (hasAnswer) {
            return true;
          }
          moves.remove(moves.size() - 1);
        }
      }
    }
    return false;
  }

  void printTiles(int state) {
    out.println(state + "-->");
    for (int row = 0; row < 4; row++) {
      for (int col = 0; col < 4; col++) {
        if (isTileEmpty(row * 4 + col, state)) {
          out.print("0");
        } else {
          out.print("1");
        }
      }
      out.println();
    }
  }

  boolean isTileEmpty(int bit, int state) {
    int newState = state | (1 << bit);
    return state != newState;
  }

  int placeTile(final int state, int bit1, int bit2) {
    int newState = state | (1 << bit1) | (1 << bit2);
    int row1 = bit1 / 4;
    int col1 = bit1 % 4;
    int row2 = bit2 / 4;
    int col2 = bit2 % 4;

    boolean isRow1 = true;
    boolean isCol1 = true;
    boolean isRow2 = true;
    boolean isCol2 = true;
    for (int col = 0; col < 4; col++) {
      if (isTileEmpty(row1 * 4 + col, newState)) {
        isRow1 = false;
        break;
      }
    }
    for (int row = 0; row < 4; row++) {
      if (isTileEmpty(row * 4 + col1, newState)) {
        isCol1 = false;
        break;
      }
    }
    for (int col = 0; col < 4; col++) {
      if (isTileEmpty(row2 * 4 + col, newState)) {
        isRow2 = false;
        break;
      }
    }
    for (int row = 0; row < 4; row++) {
      if (isTileEmpty(row * 4 + col2, newState)) {
        isCol2 = false;
        break;
      }
    }

    if (isRow1) {
      for (int col = 0; col < 4; col++) {
        int bit = row1 * 4 + col;
        if (!isTileEmpty(bit, newState)) {
          newState -= bit;
        }
      }
    }
    if (isCol1) {
      for (int row = 0; row < 4; row++) {
        int bit = row * 4 + col1;
        if (!isTileEmpty(bit, newState)) {
          newState -= bit;
        }
      }
    }
    if (isRow2) {
      for (int col = 0; col < 4; col++) {
        int bit = row2 * 4 + col;
        if (!isTileEmpty(bit, newState)) {
          newState -= bit;
        }
      }
    }
    if (isCol2) {
      for (int row = 0; row < 4; row++) {
        int bit = row * 4 + col2;
        if (!isTileEmpty(bit, newState)) {
          newState -= bit;
        }
      }
    }

    return newState;
  }

  public static void main(String[] args) {
    new Test();
  }
}


import static java.lang.System.out;

import java.util.*;

public class Test {

  Test() {
    Scanner in = new Scanner(System.in);
    String tiles = in.nextLine();
    List<List<Integer>> moves = new ArrayList<>();
    placeTiles(tiles, 0, 0, moves);
    for (List<Integer> move : moves) {
      out.println(move.get(0) + " " + move.get(1));
    }
  }

  boolean placeTiles(String tiles, int index, final int state, List<List<Integer>> moves) {
    if (index >= tiles.length()) {
      return true;
    }
    // 0 ver 1 hor
    int tileType = tiles.charAt(index) - '0';
    if (tileType == 0) {
      for (int row = 0; row < 3; row++) {
        for (int col = 0; col < 4; col++) {
          int bit1 = (row * 4) + col;
          int bit2 = ((row + 1) * 4) + col;
          if (!isTileEmpty(bit1, state) || !isTileEmpty(bit2, state)) {
            continue;
          }
          int newState = placeTile(state, bit1, bit2);
          moves.add(Arrays.asList(row + 1, col + 1));
          boolean hasAnswer = placeTiles(tiles, index + 1, newState, moves);
          if (hasAnswer) {
            return true;
          }
          moves.remove(moves.size() - 1);
        }
      }
    } else {
      for (int row = 0; row < 4; row++) {
        for (int col = 0; col < 3; col++) {
          int bit1 = (row * 4) + col;
          int bit2 = (row * 4) + col + 1;
          if (!isTileEmpty(bit1, state) || !isTileEmpty(bit2, state)) {
            continue;
          }
          int newState = placeTile(state, bit1, bit2);
          moves.add(Arrays.asList(row + 1, col + 1));
          boolean hasAnswer = placeTiles(tiles, index + 1, newState, moves);
          if (hasAnswer) {
            return true;
          }
          moves.remove(moves.size() - 1);
        }
      }
    }
    return false;
  }

  void printTiles(int state) {
    for (int row = 0; row < 4; row++) {
      for (int col = 0; col < 4; col++) {
        if (isTileEmpty(row * 4 + col, state)) {
          out.print("0");
        } else {
          out.print("1");
        }
      }
      out.println();
    }
  }

  boolean isTileEmpty(int bit, int state) {
    int newState = state | (1 << bit);
    return state != newState;
  }

  int placeTile(final int state, int bit1, int bit2) {
    int newState = state | (1 << bit1) | (1 << bit2);
    int row1 = bit1 / 4;
    int col1 = bit1 % 4;
    int row2 = bit2 / 4;
    int col2 = bit2 % 4;

    boolean isRow1 = true;
    boolean isCol1 = true;
    boolean isRow2 = true;
    boolean isCol2 = true;
    for (int col = 0; col < 4; col++) {
      if (isTileEmpty(row1 * 4 + col, newState)) {
        isRow1 = false;
        break;
      }
    }
    for (int row = 0; row < 4; row++) {
      if (isTileEmpty(row * 4 + col1, newState)) {
        isCol1 = false;
        break;
      }
    }
    for (int col = 0; col < 4; col++) {
      if (isTileEmpty(row2 * 4 + col, newState)) {
        isRow2 = false;
        break;
      }
    }
    for (int row = 0; row < 4; row++) {
      if (isTileEmpty(row * 4 + col2, newState)) {
        isCol2 = false;
        break;
      }
    }

    if (isRow1) {
      for (int col = 0; col < 4; col++) {
        int bit = row1 * 4 + col;
        if (!isTileEmpty(bit, newState)) {
          newState -= (1 << bit);
        }
      }
    }
    if (isCol1) {
      for (int row = 0; row < 4; row++) {
        int bit = row * 4 + col1;
        if (!isTileEmpty(bit, newState)) {
          newState -= (1 << bit);
        }
      }
    }
    if (isRow2) {
      for (int col = 0; col < 4; col++) {
        int bit = row2 * 4 + col;
        if (!isTileEmpty(bit, newState)) {
          newState -= (1 << bit);
        }
      }
    }
    if (isCol2) {
      for (int row = 0; row < 4; row++) {
        int bit = row * 4 + col2;
        if (!isTileEmpty(bit, newState)) {
          newState -= (1 << bit);
        }
      }
    }

    return newState;
  }

  public static void main(String[] args) {
    new Test();
  }
}


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

public class mymy
{

	static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

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

			String s=br.readLine();

			int n=s.length();

			int[] l=new int[n],r=new int[n];

			int i=0;

			while(i<n)
			{
				char c=s.charAt(i);

				int j=i+1;
				while(j<n && s.charAt(j)!=c && l[i]==0)
					j++;
				if(j<n && s.charAt(j)==c && l[i]==0)
				{
					if(c=='0')
					{
						l[i]=1;r[i]=1;l[j]=3;r[j]=1;
					}
					else
					{
						l[i]=4;r[i]=3;l[j]=4;r[j]=1;
					}
				}
				i++;
			}

			i=0;
			for(i=0;i<n;i++)
			{
				if(l[i]==0)
					{
						if(s.charAt(i)=='0')
							{l[i]=2;r[i]=2;}
						else
							{l[i]=3;r[i]=3;}
					}

			}

			i=0;
			for(i=0;i<n;i++)
			{
				System.out.println(l[i]+" "+r[i]);
			}

			// System.out.println("Yes");

	}

}


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

public class mymy
{

	static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

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

			String s=br.readLine();

			int n=s.length();

			int[] l=new int[n],r=new int[n];

			int i=0;

			while(i<n)
			{
				char c=s.charAt(i);

				int j=i+1;
				while(j<n && s.charAt(j)!=c && l[i]==0)
					j++;
				if(j<n && s.charAt(j)==c)
				{
					if(c=='0')
					{
						l[i]=1;r[i]=1;l[j]=3;r[j]=1;
					}
					else
					{
						l[i]=4;r[i]=3;l[j]=4;r[j]=1;
					}
				}
				i++;
			}

			i=0;
			for(i=0;i<n;i++)
			{
				if(l[i]==0)
					{
						if(s.charAt(i)=='0')
							{l[i]=2;r[i]=2;}
						else
							{l[i]=3;r[i]=3;}
					}

			}

			i=0;
			for(i=0;i<n;i++)
			{
				System.out.println(l[i]+" "+r[i]);
			}

			// System.out.println("Yes");

	}

}


import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution
{
	static class InputReader
	{
	    private final InputStream stream;
	    private final byte[] buf = new byte[8192];
	    private int curChar, snumChars;

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

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

	    public int nextInt() {
	      int c = read();
	      while (isSpaceChar(c)) {
	        c = read();
	      }
	      int sgn = 1;
	      if (c == '-') {
	        sgn = -1;
	        c = read();
	      }
	      int res = 0;
	      do {
	        res *= 10;
	        res += c - '0';
	        c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }

	    public long nextLong() {
	      int c = read();
	      while (isSpaceChar(c)) {
	        c = read();
	      }
	      int sgn = 1;
	      if (c == '-') {
	        sgn = -1;
	        c = read();
	      }
	      long res = 0;
	      do {
	        res *= 10;
	        res += c - '0';
	        c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	      int a[] = new int[n];
	      for (int i = 0; i < n; i++) {
	        a[i] = nextInt();
	      }
	      return a;
	    }

	    public String readString() {
	      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 String nextLine() {
	      int c = read();
	      while (isSpaceChar(c))
	        c = read();
	      StringBuilder res = new StringBuilder();
	      do {
	        res.appendCodePoint(c);
	        c = read();
	      } while (!isEndOfLine(c));
	      return res.toString();
	    }

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

	    private boolean isEndOfLine(int c) {
	      return c == '\n' || c == '\r' || c == -1;
	    }
	}
	public static void main(String[] args) throws Exception
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine().trim();
        int a = 0,b = 0;
        for(int i=0;i<str.length();i++)
        {
            if(str.charAt(i) == '0')
            {
                if(a%2 == 0)
                    System.out.println("1 1");
                else if(a%2 == 1)
                    System.out.println("3 1");
                a++;
            }
            else if(str.charAt(i) == '1')
            {
                if(b%4 == 0)
                    System.out.println("1 2");
                else if(b%4 == 1)
                    System.out.println("2 2");
                else if(b%4 == 2)
                    System.out.println("3 2");
                else if(b%4 == 3)
                    System.out.println("4 2");
                b++;
            }
        }
    }

}


import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution
{
	static class InputReader
	{
	    private final InputStream stream;
	    private final byte[] buf = new byte[8192];
	    private int curChar, snumChars;

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

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

	    public int nextInt() {
	      int c = read();
	      while (isSpaceChar(c)) {
	        c = read();
	      }
	      int sgn = 1;
	      if (c == '-') {
	        sgn = -1;
	        c = read();
	      }
	      int res = 0;
	      do {
	        res *= 10;
	        res += c - '0';
	        c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }

	    public long nextLong() {
	      int c = read();
	      while (isSpaceChar(c)) {
	        c = read();
	      }
	      int sgn = 1;
	      if (c == '-') {
	        sgn = -1;
	        c = read();
	      }
	      long res = 0;
	      do {
	        res *= 10;
	        res += c - '0';
	        c = read();
	      } while (!isSpaceChar(c));
	      return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	      int a[] = new int[n];
	      for (int i = 0; i < n; i++) {
	        a[i] = nextInt();
	      }
	      return a;
	    }

	    public String readString() {
	      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 String nextLine() {
	      int c = read();
	      while (isSpaceChar(c))
	        c = read();
	      StringBuilder res = new StringBuilder();
	      do {
	        res.appendCodePoint(c);
	        c = read();
	      } while (!isEndOfLine(c));
	      return res.toString();
	    }

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

	    private boolean isEndOfLine(int c) {
	      return c == '\n' || c == '\r' || c == -1;
	    }
	}
	public static void main(String[] args) throws Exception
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine().trim();
        Stack<Integer> st = new Stack<>();
        int len = 0;
        for(int i=0;i<str.length();i++)
        {
            if(st.isEmpty())
                st.add(i);
            else
            {
                if(str.charAt(i) == str.charAt(st.peek()))
                {
                    len++;
                    st.pop();
                }
                else
                    st.add(i);
            }
        }
        if(len % 2 == 0)
            System.out.println("NO");
        else
            System.out.println("YES");
    }

}


import java.util.Scanner;

public class C{
	static Scanner fr = new Scanner(System.in);

	public static void main(String args[]){
		String str = fr.next();
		int n = str.length();
		boolean b[][] = new boolean[4][4];
		for(int i=0;i<n;i++){
			char ch = str.charAt(i);
			if(ch == '1'){
				b = horizontal(b);
			}else{
				b = vertical(b);
			}

			b = check(b);
		}
	}

	static boolean[][] horizontal(boolean b[][]){
		boolean bool = true;
		for(int i=0;i<4;i++){
			if(b[i][0] && b[i][1] && !b[i][2] && !b[i][3]){
				for(int j=0;j<4;j++){
					b[i][j] = true;
				}
				bool = false;
				System.out.println((i+1) + " " + 3);
				break;
			}else if(!b[i][0] && !b[i][1] && b[i][2] && b[i][3]){
				for(int j=0;j<4;j++){
					b[i][j] = true;
				}
				bool = false;
				System.out.println((i+1) + " " + 1);
				break;
			}
		}

		if(!bool){
			return b;
		}

		for(int i=0;i<4 && bool;i++){
			for(int j=0;j<3 && bool;j++){
				if(!b[i][j] && !b[i][j+1]){
					System.out.println(i+1 + " " + (j+1));
					b[i][j] = true;
					b[i][j+1] = true;
					bool = false;
				}
			}
		}
		return b;
	}

	static boolean[][] vertical(boolean b[][]){
		boolean bool = true;
		for(int i=0;i<4;i++){
			if(b[0][i] && b[1][i] && !b[2][i] && !b[3][i]){
				for(int j=0;j<4;j++){
					b[j][i] = true;
				}
				System.out.println(3 + " " + (i+1));
				bool = false;
				break;
			}else if(!b[0][i] && !b[1][i] && b[2][i] && b[3][i]){
				for(int j=0;j<4;j++){
					b[j][i] = true;
				}
				System.out.println(1 + " " + (i+1));
				bool = false;
				break;
			}
		}

		if(!bool){
			return b;
		}

		for(int i=0;i<3 && bool;i++){
			for(int j=0;j<4 && bool;j++){
				if(!b[i][j] && !b[i+1][j]){
					System.out.println(i+1 + " " + (j+1));
					b[i][j] = true;
					b[i+1][j] = true;
					bool = false;
				}
			}
		}

		return b;
	}

	static boolean[][] check(boolean b[][]){
		for(int i=0;i<4;i++){
			if(b[i][0] && b[i][1] && b[i][2] && b[i][3]){
				for(int j=0;j<4;j++){
					b[i][j] = !b[i][j];
				}
			}
		}

		for(int i=0;i<4;i++){
			if(b[0][i] && b[1][i] && b[2][i] && b[3][i]){
				for(int j=0;j<4;j++){
					b[j][i] = !b[j][i];
				}
			}
		}

		return b;
	}

	static int[] nextArray(int n){
		int arr[] = new int[n];
		for(int i=0;i<n;i++){
			arr[i] = fr.nextInt();
		}
		return arr;
	}
}


import java.util.Scanner;

public class B{
	static Scanner fr = new Scanner(System.in);

	public static void main(String args[]){
		String str = fr.next();
		boolean f = true,s = true;
		int idx = 1;
		while(f && s && str.length() > 1){
			if(idx % 2 == 1){
				String temp = play(str);
				if(temp.length() == str.length()){
					f = false;
				}else{
					str = temp;
				}
			}else{
				String temp = play(str);
				if(temp.length() == str.length()){
					s = false;
				}else{
					str = temp;
				}
			}

			idx ++;
		}

		if(!f){
			System.out.println("No");
		}else{
			System.out.println("Yes");
		}
	}

	static String play(String str){
		int n = str.length();
		for(int i=0;i<n-1;i++){
			if(str.charAt(i) == str.charAt(i+1)){
				str = str.substring(0, i) + str.substring(i+2);
				break;
			}
		}
		return str;
	}

	static int[] nextArray(int n){
		int arr[] = new int[n];
		for(int i=0;i<n;i++){
			arr[i] = fr.nextInt();
		}
		return arr;
	}
}


import java.util.Scanner;

public class C{
	static Scanner fr = new Scanner(System.in);

	public static void main(String args[]){
		String str = fr.next();
		int n = str.length();
		boolean b[][] = new boolean[4][4];
		for(int i=0;i<n;i++){
			char ch = str.charAt(i);
			if(ch == '1'){
				b = horizontal(b);
			}else{
				b = vertical(b);
			}

			b = check(b);
		}
	}

	static boolean[][] horizontal(boolean b[][]){
		boolean bool = true;
		for(int i=0;i<4 && bool;i++){
			for(int j=0;j<3 && bool;j++){
				if(!b[i][j] && !b[i][j+1]){
					System.out.println(i+1 + " " + (j+1));
					b[i][j] = true;
					b[i][j+1] = true;
					bool = false;
				}
			}
		}
		return b;
	}

	static boolean[][] vertical(boolean b[][]){
		boolean bool = true;
		for(int i=0;i<3 && bool;i++){
			for(int j=0;j<4 && bool;j++){
				if(!b[i][j] && !b[i+1][j]){
					System.out.println(i+1 + " " + (j+1));
					b[i][j] = true;
					b[i+1][j] = true;
					bool = false;
				}
			}
		}

		return b;
	}

	static boolean[][] check(boolean b[][]){
		for(int i=0;i<4;i++){
			if(b[i][0] && b[i][1] && b[i][2] && b[i][3]){
				for(int j=0;j<4;j++){
					b[i][j] = !b[i][j];
				}
			}
		}

		for(int i=0;i<4;i++){
			if(b[0][i] && b[1][i] && b[2][i] && b[3][i]){
				for(int j=0;j<4;j++){
					b[j][i] = !b[j][i];
				}
			}
		}

		return b;
	}

	static int[] nextArray(int n){
		int arr[] = new int[n];
		for(int i=0;i<n;i++){
			arr[i] = fr.nextInt();
		}
		return arr;
	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class q5 {

	static ArrayList<Integer>[] graph;
	static int[] visited;
	static long[] sums;
	static long[] val;
	static boolean possible=true;
	 public static int gcd(int a,int b) {
		 if(b==0) return a;
		 else return gcd(b,a%b);
	 }

	 // Credits to GFG
	 static public void dfs(int start, long sum) {
		 visited[start]=1;
		 if(sums[start]==-1) {
			 long min=Long.MAX_VALUE;
			 for(int i:graph[start]) {
				 min=Math.min(min, sums[i]);
			 }
			 if(min!=Long.MAX_VALUE && min>=sum) {
				 val[start]+=min-sum;
			 }
			 else if(min==Long.MAX_VALUE){

			 }
			 else {
				 possible=false;return;
			 }
			 for(int i:graph[start]) dfs(i,min);
		 }
		 else {
			 if(sums[start]-sum<0) {
				 possible=false;
			 }
			 else {
				 val[start]=sums[start]-sum;
				 for(int i:graph[start]) {
					 dfs(i,sums[start]);
				 }
			 }

		 }

	 }

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		// Editorial implementation for practice
		Reader.init(System.in);
		StringBuffer output=new StringBuffer("");
		PrintWriter out=new PrintWriter(System.out);
		String s=Reader.next();
		int one=0;
		int z=0;
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='0') {
				if(z==0) {
					output.append("1 1\n");
					z=1;
				}
				else {
					z=0;
					output.append("3 1\n");
				}
			}
			else {
				if(one==0) {
					one=1;
					output.append("4 3\n");
				}
				else {
					output.append("4 1\n");
				}
			}
		}
		out.write(output.toString());
		out.flush();
	}
}

 class Reader {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;

	    /** call this method to initialize reader for InputStream */
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }

	    /** get next word */
	    static String nextLine() throws IOException{
	    	return reader.readLine();
	    }
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }

	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class q5 {

	static ArrayList<Integer>[] graph;
	static int[] visited;
	static long[] sums;
	static long[] val;
	static boolean possible=true;
	 public static int gcd(int a,int b) {
		 if(b==0) return a;
		 else return gcd(b,a%b);
	 }

	 // Credits to GFG
	 static public void dfs(int start, long sum) {
		 visited[start]=1;
		 if(sums[start]==-1) {
			 long min=Long.MAX_VALUE;
			 for(int i:graph[start]) {
				 min=Math.min(min, sums[i]);
			 }
			 if(min!=Long.MAX_VALUE && min>=sum) {
				 val[start]+=min-sum;
			 }
			 else if(min==Long.MAX_VALUE){

			 }
			 else {
				 possible=false;return;
			 }
			 for(int i:graph[start]) dfs(i,min);
		 }
		 else {
			 if(sums[start]-sum<0) {
				 possible=false;
			 }
			 else {
				 val[start]=sums[start]-sum;
				 for(int i:graph[start]) {
					 dfs(i,sums[start]);
				 }
			 }

		 }

	 }

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		// Editorial implementation for practice
		Reader.init(System.in);
		StringBuffer output=new StringBuffer("");
		PrintWriter out=new PrintWriter(System.out);
		String s=Reader.next();
		int one=0;
		int z=0;
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='0') {
				if(z==0) {
					output.append("1 1\n");
					z=1;
				}
				else {
					z=0;
					output.append("3 1\n");
				}
			}
			else {
				if(one==0) {
					one=1;
					output.append("4 3\n");
				}
				else {
					output.append("4 1\n");
					one=0;
				}
			}
		}
		out.write(output.toString());
		out.flush();
	}
}

 class Reader {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;

	    /** call this method to initialize reader for InputStream */
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }

	    /** get next word */
	    static String nextLine() throws IOException{
	    	return reader.readLine();
	    }
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }

	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	}


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') {
					int minr = (int)(1e6), minc = (int)(1e6);
					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) {
								if (i + k < minr + minc) {
									minr = i;
									minc = k;
								}
							}
						}
						if (flag == 1) {
							break;
						}
					}

					grid[minr][minc] = 1;
					grid[minr+1][minc] = 1;
					ans.append(minr + 1 + " " + (minc + 1));
				} else {
					int minr = (int)(1e6), minc = (int)(1e6);
					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) {
								if (i + k < minr + minc) {
									minr = i;
									minc = k;
								}
							}
						}
						if (flag == 1) {
							break;
						}
					}

					grid[minr][minc] = 1;
					grid[minr][minc + 1] = 1;
					ans.append(minr + 1 + " " + (minc + 1));
				}
				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.InputMismatchException;

/**
 * @author thesparkboy
 *
 */

public class A2 {

	// Code Begins Here

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

	static void reset() {
		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) {
				for (int j = 0; j < 4; j++) {
					grid[i][j] = 0;
				}
			}
		}
		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) {
				for (int j = 0; j < 4; j++) {
					grid[j][i] = 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();
		}
	}
}