Problem: You are given a 4x4 grid. You play a game — there is a sequence of tiles, each of them is either 2x1 or 1x2. Your task is to consequently place all tiles from the given sequence in the grid. When tile is placed, each cell which is located in fully occupied row or column is deleted (cells are deleted at the same time independently). You can place tile in the grid at any position, the only condition is that tiles (and tile parts) should not overlap. Your goal is to proceed all given figures and avoid crossing at any time.

Input

The only line contains a string s consisting of zeroes and ones (1 ≤ |s| ≤ 1000). Zero describes vertical tile, one describes horizontal tile.

Output

Output |s| lines — for each tile you should output two positive integers r,c, not exceeding 4, representing numbers of smallest row and column intersecting with it.

If there exist multiple solutions, print any of them.

Example

Input


010


Output


1 1
1 2
1 4

Note

Following image illustrates the example after placing all three tiles: 

<image> Then the first row is deleted:  <image>

Solution (in JAVA):

Solution:


import java.util.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.io.*;
import java.util.HashMap;
import java.io.BufferedReader; 
import java.io.FileReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.io.DataInputStream; 
import java.io.FileInputStream; 
public class Prac {
    public static int min(int a,int b,int c){
        if(a<b){
            if(a<c)
                return a;
            
            else
                return c;
        }
        else{
            if(b<c)
                return b;
            else
                return c;
        }   
}
    public static int max(int a,int b,int c){
        if(a<b){
            if(b<c)
                return c;
            
            else
                return b;
        }
        else{
            if(a<c)
                return c;
            else
                return a;
        }   
}
    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 ni() {
			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 nl() {
			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[] nia(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = ni();
			}
			return a;
		}
 
		public String rs() {
			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;
		}
 
	}
    static abstract class MultiSetImpl<ValueType, MapType extends Map<ValueType, Integer>> implements MultiSet<ValueType> {
        protected final MapType map;
        protected int size;
        protected int distinctCount;

        protected MultiSetImpl(MapType map) {
            this.map = map;
            this.size = 0;
        }

        public void add(ValueType value) {
            int count = getCount(value);
            if (count == 0) ++distinctCount;
            map.put(value, count + 1);
            ++size;
        }

        public boolean remove(ValueType value) {
            int count = getCount(value);
            if (count == 0) return false;

            if (count == 1) map.remove(value);
            else map.put(value, count - 1);
            if (count == 1) --distinctCount;
            --size;
            return true;
        }

        public int getCount(ValueType value) {
            Integer count = map.get(value);
            return (count == null ? 0 : count);
        }

        @Override
        public String toString() {
            StringBuilder stringBuilder = new StringBuilder();
            for (ValueType key : map.keySet()) {
                stringBuilder.append("[" + key.toString() + " " + map.get(key).toString() + "] ");
            }
            return stringBuilder.toString();
        }

    }

    static interface MultiSet<ValueType> {
    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

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

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

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

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

    }

    static class HashMultiSet<ValueType> extends MultiSetImpl<ValueType, Map<ValueType, Integer>> {
        public HashMultiSet(Map<ValueType, Integer> map) {
            super(map);
        }

    }

  static long modInverse(long a, long m){
      long num=m;
      long x=1;
      long power=a;
      while(num>0){
          if(num%2==1){
              x=(x*power)%mod;
          }
         num=num/2;
         power=(power*power)%mod;
         
      }
      return x;
  }
  static long mod=1000000007;
  public static long fact[]=new long[1000005];
   public static void findFact(){
         fact[0]=1;
         for(int i=1;i<=1000000;i++){
             fact[i]=(i*fact[i-1])%mod;
         }
     }
public static long nCr(int n,int r){
    return (fact[n]*modInverse((fact[r]*fact[n-r])%mod,1000000005))%mod;
}
public static long nPr(int n,int r){
    return (fact[n]*modInverse(fact[n-r],1000000005))%mod;
}    
    static PrintWriter w = new PrintWriter(System.out);
     
     
    
    public static void main(String[] args) throws IOException {   
        InputReader sc=new InputReader(System.in);
        //Scanner sc=new Scanner(System.in);
        //HashMultiSet<Integer> multiSet = new HashMultiSet<>(new HashMap<>());
       StringBuilder sb = new StringBuilder();
       //findFact();
       
       
       String s=sc.nextLine();
       int n=s.length();
       boolean matrix[][]=new boolean[4][4];
       int ans[][]=new int[n][2];
       int i=0,j=0,k=0;
       
      int r1=0,c1=0,r2=0,c2=0;
      
       for(i=0;i<n;i++){
           if(s.charAt(i)=='0'){
               matrix[r1][c1]=true;
               matrix[r1+1][c1]=true;
               ans[i][0]=r1+1;
               ans[i][1]=c1+1;
               r1+=2;
               if(r1==4){
                   matrix[0][0]=false;
                   matrix[1][0]=false;
                   matrix[2][0]=false;
                   matrix[3][0]=false;
                   r1=0;
               }
           }
           else{
               matrix[r2][2]=true;
               matrix[r2][3]=true;
               ans[i][0]=r2+1;
               ans[i][1]=3;
               r2+=1;
               if(r2==4){
                   matrix[0][2]=false;
                   matrix[1][2]=false;
                   matrix[2][2]=false;
                   matrix[3][2]=false;
                   matrix[0][3]=false;
                   matrix[1][3]=false;
                   matrix[2][3]=false;
                   matrix[3][3]=false;
                   r2=0;
               }
                
         
           }
       } 
       for(i=0;i<n;i++)
           w.println(ans[i][0]+" "+ans[i][1]);
       /*int n=sc.ni();
       int m=sc.ni();
       int p=sc.ni();
       int speed[]=new int[p+1];
       int i=0,j=0;
       for(i=1;i<=p;i++)
           speed[i]=sc.ni();
       String sym[]=new String [n];
       int count=0;
       boolean cell[][]=new boolean[n][m];
       for(i=0;i<n;i++){
           sym[i]=sc.nextLine();
           for(j=0;j<m;j++){
               if(sym[i].charAt(j)=='.'){
                   cell[i][j]=false;
               }
               else if(sym[i].charAt(j)=='#'){
                   
               }
           }
       }*/
      /*String s=sc.nextLine();
      sb.append(s);
      int same=0;
      int i=0;
      boolean first=false,sec=false;
      boolean p1=true,p2=false;
      outer:
      while(sb.length()>1){
          for(i=0;i<s.length()-1;i++){
              if(sb.charAt(i)==sb.charAt(i+1)&&p1){
                  p1=false;
                  p2=true;
                  sb.deleteCharAt(i);
                  sb.deleteCharAt(i+1);
                  break;
              }
              else if(sb.charAt(i)==sb.charAt(i+1)&&p2){
                  p1=true;
                  p2=false;
                  sb.deleteCharAt(i);
                  sb.deleteCharAt(i+1);
                  break;1001
              }
              else {
                  break outer;
              }
        }
          
      }
      if(p1)
          w.println("NO");
      else
          w.println("YES");
     
      */
       w.close();
    }  
}