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

Input

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

Output

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

If there exist multiple solutions, print any of them.

Example

Input


010


Output


1 1
1 2
1 4

Note

Following image illustrates the example after placing all three tiles: 

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

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author @Ziklon
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    OutputWriter out = new OutputWriter(outputStream);
    CGridGame solver = new CGridGame();
    solver.solve(1, in, out);
    out.close();
  }

  static class CGridGame {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
      boolean[][] table = new boolean[4][4];

      String s = in.readLine();
      for (char c : s.toCharArray()) {
        int x = 4, y = 4;
        if (c == '1') {
          boolean found = false;
          for (int i = 0; i < 4 && !found; ++i)
            for (int j = 0; j + 1 < 4 && !found; ++j)
              if (table[i][j] == false && table[i][j + 1] == false) {
                found = true;
                x = i + 1;
                y = j + 1;
                table[i][j] = true;
                table[i][j + 1] = true;
              }
        } else {
          boolean found = false;
          for (int j = 0; j < 4 && !found; ++j)
            for (int i = 0; i + 1 < 4 && !found; ++i)
              if (table[i][j] == false && table[i + 1][j] == false) {
                found = true;
                x = i + 1;
                y = j + 1;
                table[i][j] = true;
                table[i + 1][j] = true;
              }
        }
        out.printLine(x, y);
        cleanUp(table);
      }
    }

    void cleanUp(boolean[][] table) {
      boolean[] row = new boolean[4];
      boolean[] col = new boolean[4];
      Arrays.fill(row, true);
      Arrays.fill(col, true);
      for (int i = 0; i < 4; ++i)
        for (int j = 0; j < 4; ++j) {
          row[i] &= table[i][j];
          col[j] &= table[i][j];
        }

      for (int i = 0; i < 4; ++i)
        for (int j = 0; j < 4; ++j) {
          if (row[i] || col[j]) table[i][j] = false;
        }
    }
  }

  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++];
    }

    private String readLine0() {
      StringBuilder buf = new StringBuilder();
      int c = read();
      while (c != '\n' && c != -1) {
        if (c != '\r') {
          buf.appendCodePoint(c);
        }
        c = read();
      }
      return buf.toString();
    }

    public String readLine() {
      String s = readLine0();
      while (s.trim().length() == 0) {
        s = readLine0();
      }
      return s;
    }
  }

  static class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
      writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(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();
    }
  }
}