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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long N = 10;
const long long INF = 1e17 + 10;
const long long mod = 1e9 + 7;
long long n, m, i, j, x, y, c[N][N];
void check() {
  long long i, j;
  for (i = 1; i <= 4; ++i) {
    long long f = 0;
    for (j = 1; j <= 4; ++j)
      if (c[i][j] == 0) f = 1;
    if (!f)
      for (j = 1; j <= 4; ++j) c[i][j] = 2;
  }
  for (j = 1; j <= 4; ++j) {
    long long f = 0;
    for (i = 1; i <= 4; ++i)
      if (c[i][j] == 0) f = 1;
    if (!f)
      for (i = 1; i <= 4; ++i) c[i][j] = 2;
  }
  for (i = 1; i <= 4; ++i)
    for (j = 1; j <= 4; ++j)
      if (c[i][j] == 2) c[i][j] = 0;
}
long long f(long long x1, long long y1, long long x2, long long y2) {
  c[x1][y1] = 1;
  c[x2][y2] = 1;
  long long i, f = 1, x = 0;
  for (i = 1; i <= 4; ++i) f &= c[i][y1];
  x += f, f = 1;
  for (i = 1; i <= 4; ++i) f &= c[i][y2];
  x += f, f = 1;
  for (i = 1; i <= 4; ++i) f &= c[x1][i];
  x += f, f = 1;
  for (i = 1; i <= 4; ++i) f &= c[x2][i];
  c[x1][y1] = 0;
  c[x2][y2] = 0;
  return x;
}
int main() {
  for (i = 0; i <= 5; ++i) c[i][0] = c[i][5] = 1;
  for (i = 0; i <= 5; ++i) c[0][i] = c[5][i] = 1;
  vector<pair<long long, long long> > r;
  string s;
  cin >> s;
  n = s.size();
  for (i = 0; i < n; ++i) {
    if (s[i] == '0') {
      long long ans = -1, cx, cy;
      for (x = 1; x <= 4; ++x)
        for (y = 1; y <= 4; ++y)
          if (c[x][y] == 0 && c[x + 1][y] == 0) {
            long long s = f(x, y, x + 1, y);
            if (ans < s) ans = s, cx = x, cy = y;
          }
      if (ans == -1) return cout << "Error" << endl, 0;
      c[cx][cy] = 1;
      c[cx + 1][cy] = 1;
      check();
      r.push_back({cx, cy});
    } else {
      long long ans = -1, cx, cy;
      for (x = 1; x <= 4; ++x)
        for (y = 1; y <= 4; ++y)
          if (c[x][y] == 0 && c[x][y + 1] == 0) {
            long long s = f(x, y, x, y + 1);
            if (ans < s) ans = s, cx = x, cy = y;
          }
      if (ans == -1) return cout << "Error" << endl, 0;
      c[cx][cy] = 1;
      c[cx][cy + 1] = 1;
      check();
      r.push_back({cx, cy});
    }
    long long i, j;
  }
  for (auto it : r) cout << it.first << " " << it.second << endl;
}