#include <bits/stdc++.h>
#include <string>
#include <cmath>
#include <sstream>
//#include <unordered_map>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, a, b) for (int i = (a - 1); i >= (b); i--)
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
typedef long long int ll;
using namespace std;
ll mod = 1000000007;
//ll mod=67280421310721;
//ll mod=998244353;
ll powmod(ll a, ll b)
{
    ll res = 1;
    a %= mod;
    assert(b >= 0);
    for (; b; b >>= 1)
    {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;
    while (t--)
    {
        ll  n,m=1,flag = 0,f=100000000,t=0,ans=1000000000,d;

        char c[1005];
        string s;
        cin>>c;

        s=c;

        int a[4][4];
        memset(a,0,sizeof(a));
        n=s.length();
        FOR(k,0,n)
        {
            if(s[k]=='0')
            {
                FORD(i,3,0)
                {
                    flag=0;
                    FOR(j,0,4){
                        if(a[i][j]==0 && a[i+1][j]==0)
                        {
                            a[i][j]=1;
                            a[i+1][j]=1;
                            cout<<i+1<<" "<<j+1<<endl;
                            flag=1;
                            break;
                        }
                    }
                    if(flag) break;
                }
                FOR(i,0,4)
                {
                    if(a[i][0]==1 && a[i][1]==1 && a[i][2]==1 && a[i][3]==1)
                    {
                        FOR(j,0,4)
                        {
                            a[i][j]=0;
                        }
                    }
                }
            }
            else{
                FORD(i,4,0)
                {
                    flag=0;
                    FOR(j,0,3)
                    {
                        if(a[i][j]==0 && a[i][j+1]==0)
                        {
                            a[i][j]=1;
                            a[i][j+1]=1;
                            cout<<i+1<<" "<<j+1<<endl;
                            flag=1;
                            break;
                        }
                    }
                    if(flag) break;
                }
                FOR(i,0,4)
                {
                    if(a[i][0]==1 && a[i][1]==1 && a[i][2]==1 && a[i][3]==1)
                    {
                        FOR(j,0,4)
                        {
                            a[i][j]=0;
                        }
                    }
                }
            }

        }

    }
    // your code goes here
    return 0;
}


#include <bits/stdc++.h>
#include <string>
#include <cmath>
#include <sstream>
//#include <unordered_map>
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, a, b) for (int i = (a - 1); i >= (b); i--)
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
typedef long long int ll;
using namespace std;
ll mod = 1000000007;
//ll mod=67280421310721;
//ll mod=998244353;
ll powmod(ll a, ll b)
{
    ll res = 1;
    a %= mod;
    assert(b >= 0);
    for (; b; b >>= 1)
    {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;
    while (t--)
    {
        ll  n,m=1,flag = 0,f=100000000,t=0,ans=1000000000,d;

        char s[1005];

        scanf("%s",s);
        n=strlen(s);

        int a[4][4];
        memset(a,0,sizeof(a));

        FOR(k,0,n)
        {
            if(s[k]=='0')
            {
                FORD(i,3,0)
                {
                    flag=0;
                    FOR(j,0,4){
                        if(a[i][j]==0 && a[i+1][j]==0)
                        {
                            a[i][j]=1;
                            a[i+1][j]=1;
                            cout<<i+1<<" "<<j+1<<endl;
                            flag=1;
                            break;
                        }
                    }
                    if(flag) break;
                }
                FOR(i,0,4)
                {
                    if(a[i][0]==1 && a[i][1]==1 && a[i][2]==1 && a[i][3]==1)
                    {
                        FOR(j,0,4)
                        {
                            a[i][j]=0;
                        }
                    }
                }
            }
            else{
                FORD(i,4,0)
                {
                    flag=0;
                    FOR(j,0,3)
                    {
                        if(a[i][j]==0 && a[i][j+1]==0)
                        {
                            a[i][j]=1;
                            a[i][j+1]=1;
                            cout<<i+1<<" "<<j+1<<endl;
                            flag=1;
                            break;
                        }
                    }
                    if(flag) break;
                }
                FOR(i,0,4)
                {
                    if(a[i][0]==1 && a[i][1]==1 && a[i][2]==1 && a[i][3]==1)
                    {
                        FOR(j,0,4)
                        {
                            a[i][j]=0;
                        }
                    }
                }
            }

        }

    }
    // your code goes here
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int horiz = 1;
	int vert = 2;
	int hpos = 1;
	int vpos = 1;
	for(int i = 0; i<s.length(); i++){
		if(s[i]=='0'){
			cout << vert << " " << vpos++ << endl;
			if(vpos==5){
				if(horiz>vert){
					horiz-=2;
				}
				if(horiz>=3){
					vert = 1;
				}
				else{
					vert = 3;
				}
				vpos = 1;
			}
		}
		else{
			cout << horiz << " " << hpos << endl;
			hpos += 2;
			if(hpos==5){
				if(vert > horiz){
					vert--;
				}
				if(vert>=2){
					horiz = 1;
				}
				else{
					horiz = 3;
				}
				hpos = 1;
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int horiz = 1;
	int vert = 2;
	int hpos = 1;
	int vpos = 1;
	for(int i = 0; i<s.length(); i++){
		if(s[i]=='0'){
			cout << vert << " " << vpos++ << endl;
			if(vpos==5){
				if(horiz>vert){
					horiz-=2;
				}
				if(horiz>=3){
					vert = 1;
				}
				else{
					vert = 3;
				}
				vpos = 1;
			}
		}
		else{
			cout << vert << " " << hpos << endl;
			hpos += 2;
			if(hpos==5){
				if(vert > horiz){
					vert--;
				}
				if(vert>=2){
					horiz = 1;
				}
				else{
					horiz = 3;
				}
				hpos = 1;
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int horiz = 1;
	int vert = 2;
	int hpos = 1;
	int vpos = 1;
	for(int i = 0; i<s.length(); i++){
		if(s[i]=='0'){
			cout << vert << " " << vpos++ << endl;
			if(vpos==5){
				if(horiz>vert){
					horiz-=2;
				}
				vert = 3;
				vpos = 1;
			}
		}
		else{
			cout << horiz << " " << hpos << endl;
			hpos += 2;
			if(hpos==5){
				if(vert > horiz){
					vert--;
				}
				horiz = 4;
				hpos = 1;
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int horiz = 1;
	int vert = 2;
	int hpos = 1;
	int vpos = 1;
	for(int i = 0; i<s.length(); i++){
		if(s[i]=='0'){
			cout << vert << " " << vpos++ << endl;
			if(vpos==5){
				vert = 3;
				vpos = 1;
			}
		}
		else{
			cout << horiz << " " << hpos << endl;
			hpos += 2;
			if(hpos==5){
				horiz = 4;
				hpos = 1;
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int horiz = 1;
	int vert = 3;
	int hpos = 1;
	int vpos = 1;
	for(int i = 0; i<s.length(); i++){
		if(s[i]=='0'){
			cout << vert << " " << vpos++ << endl;
			if(vpos==5){
				vpos = 1;
			}
		}
		else{
			cout << horiz << " " << hpos << endl;
			hpos += 2;
			if(hpos==5){
				hpos = 1;
			}
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD 1000000007
#define mod 1000000007
#define  mfor(i,a,b)  for(int i=a;i<=b;i++)
#define p_b  push_back
#define m_p make_pair
typedef  long long int ll;

int main()
{
  SPEED
  string s;
  cin>>s;
  int zct=0;
  int oct=0;
  for(int i=0;i<s.size();i++)
  {
      if(s[i]=='0')
      {
          zct++;
          if(zct%2==1)
          {
              cout<<1<<" "<<1<<endl;
          }
          else
            cout<<3<<" "<<1<<endl;
      }
      else
      {
          oct++;
          cout<< (oct%5)<<" "<<2<<endl;
      }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD 1000000007
#define mod 1000000007
#define  mfor(i,a,b)  for(int i=a;i<=b;i++)
#define p_b  push_back
#define m_p make_pair
typedef  long long int ll;

int main()
{
  SPEED
  string s;
  cin>>s;
  int zct=0;
  int oct=0;
  for(int i=0;i<s.size();i++)
  {
      if(s[i]=='0')
      {
          zct++;
          if(zct%2==1)
          {
              cout<<1<<" "<<1<<endl;
          }
          else
            cout<<3<<" "<<1<<endl;
      }
      else
      {
          oct++;
          int temp = oct%4;
          if(temp==0)
            temp=4;
          cout<< temp<<" "<<2<<endl;
      }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e3 + 5;

char s[MAXN];
int hor, ver;

void out(int a, int b) {
	printf("%d %d\n", ++a, ++b);
}

int main() {
	scanf("%s", s);

	for (int i = 0; s[i]; i++)
		if (s[i] == '1') {
			out(hor, 0);
			hor = (hor + 1) % 4;
		}
		else {
			out(ver, 3);
			ver = (ver + 2) % 4;
		}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e3 + 5;

int N;
char s[MAXN];

void out(int a, int b, int c, int d) {
	printf("%d %d\n", a, b);
	printf("%d %d\n", c, d);
}

int main() {
	scanf("%s", s);
	N = strlen(s);

	bool f = false;
	for (int i = 0; i < N - 1; i += 2)
		if (s[i] == s[i + 1]) {
			if (s[i] == '0')
				out(1, 4, 3, 4);
			else
				out(4, 1, 4, 3);
		}
		else if (f) {
			if (s[i] == '0')
				out(1, 4, 2, 1);
			else
				out(2, 1, 1, 4);
			f = false;
		}
		else {
			if (s[i] == '0')
				out(1, 3, 1, 1);
			else
				out(1, 1, 1, 3);
			f = true;
		}

	if (N % 2) {
		if (s[N - 1] == '0')
			puts("3 4");
		else
			puts("4 3");
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e3 + 5;

int N;
char s[MAXN];

void out(int a, int b, int c, int d) {
	printf("%d %d\n", a, b);
	printf("%d %d\n", c, d);
}

int main() {
	scanf("%s", s);
	N = strlen(s);

	bool f = false;
	for (int i = 0; i < N - 1; i += 2)
		if (s[i] == s[i + 1]) {
			if (s[i] == '0')
				out(1, 4, 3, 4);
			else
				out(4, 1, 4, 3);
		}
		else if (f) {
			if (s[i] == '0')
				out(1, 4, 2, 1);
			else
				out(2, 1, 1, 4);
			f = false;
		}
		else {
			if (s[i] == '0')
				out(1, 3, 1, 1);
			else
				out(1, 1, 1, 3);
			f = false;
		}

	if (N % 2) {
		if (s[N - 1] == '0')
			puts("3 4");
		else
			puts("4 3");
	}

	return 0;
}


#include<bits/stdc++.h>
#define eps 1e-8
#define eq(x,y) (fabs((x)-(y)) < eps)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const ll mod= 1e9+7;
long double PI = acosl(-1);
const ll inf = 1e16;
const int nmax = 2e5+5;
const int max2 = 1<<16+5;

int a[5][5];
int bhorse[2][4];

void work(){
    int tmp[5][5];
    for(int i=1; i<=4; i++) for(int j=1; j<=4; j++) tmp[i][j]=1;

    for(int i=1; i<=4; i++){
        bool hobe = true;
        for(int j=1; j<=4; j++) if(a[i][j]==0) hobe=false;
        if(hobe) for(int j=1; j<=4; j++) tmp[i][j]=0;
    }

    for(int j=1; j<=4; j++){
        bool hobe = true;
        for(int i=1; i<=4; i++) if(a[i][j]==0) hobe=false;
        if(hobe) for(int i=1; i<=4; i++) tmp[i][j]=0;
    }

    for(int i=1; i<=4; i++) for(int j=1; j<=4; j++) a[i][j]&=tmp[i][j];

//    for(int i=1; i<=4; i++){
//        for(int j=1; j<=4; j++){
//            cout<<a[i][j];
//        }
//        cout<<endl;
//    }

}

int main(){
    ios::sync_with_stdio(false); cin.tie(0);

    string s;
    cin>>s;

    for(int i=0; i<s.size(); i++){
        if(s[i]=='0'){
            for(int i=1; i<4; i++){
                bool hoise=false;
                for(int j=1; j<=4; j++){
                    if(a[i][j]==0 and a[i+1][j]==0){ cout<<i<<" "<<j<<"\n"; a[i][j]=a[i+1][j]=1; hoise=true; break;}
                }
                if(hoise) break;
            }
        }
        else{
            for(int i=1; i<=4; i++){
                bool hoise=false;
                for(int j=1; j<4; j++){
                    if(a[i][j]==0 and a[i][j+1]==0){ cout<<i<<" "<<j<<"\n"; a[i][j]=a[i][j+1]=1; hoise=true; break;}
                }
                if(hoise) break;
            }
        }
        work();
    }

}


#include<bits/stdc++.h>
#define eps 1e-8
#define eq(x,y) (fabs((x)-(y)) < eps)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const ll mod= 1e9+7;
long double PI = acosl(-1);
const ll inf = 1e16;
const int nmax = 2e5+5;
const int max2 = 1<<16+5;

int a[5][5];
int bhorse[2][4];

void work(){
    int tmp[5][5];
    for(int i=1; i<=4; i++) for(int j=1; j<=4; j++) tmp[i][j]=1;

    for(int i=1; i<=4; i++){
        bool hobe = true;
        for(int j=1; j<=4; j++) if(a[i][j]==0) hobe=false;
        if(hobe) for(int j=1; j<=4; j++) tmp[i][j]=0;
    }

    for(int j=1; j<=4; j++){
        bool hobe = true;
        for(int i=1; i<=4; i++) if(a[i][j]==0) hobe=false;
        if(hobe) for(int i=1; i<=4; i++) tmp[i][j]=0;
    }

    for(int i=1; i<=4; i++) for(int j=1; j<=4; j++) a[i][j]&=tmp[i][j];

//    for(int i=1; i<=4; i++){
//        for(int j=1; j<=4; j++){
//            cout<<a[i][j];
//        }
//        cout<<endl;
//    }

    if(a[1][1] or a[2][1]) bhorse[0][0]=true;
    if(a[3][1] or a[4][1]) bhorse[0][2]=true;
    if(a[1][4] or a[2][4]) bhorse[0][1]=true;
    if(a[3][4] or a[4][4]) bhorse[0][3]=true;
    if(a[1][2] or a[1][3]) bhorse[1][0]=true;
    if(a[2][2] or a[2][3]) bhorse[1][1]=true;
    if(a[3][2] or a[3][3]) bhorse[1][2]=true;
    if(a[4][2] or a[4][3]) bhorse[1][3]=true;

}

int main(){
    ios::sync_with_stdio(false); cin.tie(0);

    string s;
    cin>>s;

    for(int i=0; i<s.size(); i++){
        if(s[i]=='0'){
            for(int j=0; j<4; j++){
                if(bhorse[0][j]==0){
                    if(j==0) cout<<"1 1\n", a[1][1]=a[2][1]=1;
                    else if(j==1) cout<<"1 4\n", a[1][4]=a[2][4]=1;
                    else if(j==2) cout<<"3 1\n", a[3][1]=a[4][1]=1;
                    else if(j==3) cout<<"3 4\n", a[3][4]=a[4][4]=1;
                    break;
                }
            }
        }
        else{
            for(int j=0; j<4; j++){
                if(bhorse[1][j]==0){
                    if(j==0) cout<<"1 2\n", a[1][2]=a[1][3]=1;
                    else if(j==1) cout<<"2 2\n", a[2][2]=a[2][3]=1;
                    else if(j==2) cout<<"3 2\n", a[3][2]=a[3][3]=1;
                    else if(j==3) cout<<"4 2\n", a[4][2]=a[4][3]=1;
                    break;
                }
            }
        }
        work();
    }

}


//MS0089 COR LTD..........
//All rights reserved.....
#include<bits/stdc++.h>
using namespace std;
#define mcout(a) for(auto i=a.begin();i!=a.end();i++)cout<<*i<<" ";
#define mcin(a,n) for(int i=0;i<n;i++)cin>>a[i];
#define mnl cout<<endl;
#define mv(data,n) vector<int> data(n);
#define ll long long
#define si 10
int main()
{
    string s;
    cin>>s;
    int one=0,zero=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='1')
        {
          if(one%2==0)
          {
                cout<<"1"<<" "<<"3"<<endl;
          }
          else
          {
              cout<<"1"<<" "<<"1"<<endl;
          }
          one++;
        }
        else
        {

            if(zero%2==0)
            {
                cout<<"3"<<" "<<"1"<<endl;
            }
            else
            {
                cout<<"1"<<" "<<"1"<<endl;
            }
            zero++;
        }
    }
    return 0;

}


//MS0089 COR LTD..........
//All rights reserved.....
#include<bits/stdc++.h>
using namespace std;
#define mcout(a) for(auto i=a.begin();i!=a.end();i++)cout<<*i<<" ";
#define mcin(a,n) for(int i=0;i<n;i++)cin>>a[i];
#define mnl cout<<endl;
#define mv(data,n) vector<int> data(n);
#define ll long long
#define si 10
int main()
{
    string s;
    cin>>s;
    int one=0,zero=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='1')
        {
          if(one%2==0)
          {
                cout<<"1"<<" "<<"3"<<endl;
          }
          else
          {
              cout<<"1"<<" "<<"1"<<endl;
          }
          one++;
        }
        else
        {

            if(zero%2==0)
            {
                cout<<"3"<<" "<<"4"<<endl;
            }
            else
            {
                cout<<"1"<<" "<<"1"<<endl;
            }
            zero++;
        }
    }
    return 0;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> opset;
#define SZ(X) ((int)X.size())
#define ALL(I) I.begin(), I.end()
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define eps 1e-12
#define INF 1000000007
#define MXN 200005
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

char s[MXN];
bool vis[5][5];
int v, h;

int main(){
	scanf("%s", s);
	for(int i = 0; s[i]; i ++){
		if(s[i] == '0'){
			if(h == 0) puts("1 1");
			if(h == 1) puts("1 2");
			if(h == 2) puts("3 1");
			if(h == 3) puts("3 2");
			h = (h + 1) % 4;
		} else {
			if(v == 0) puts("1 3");
			if(v == 1) puts("2 3");
			if(v == 2) puts("3 3");
			if(v == 3) puts("4 3");
			v = (v + 1) % 4;
		}
	}
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> opset;
#define SZ(X) ((int)X.size())
#define ALL(I) I.begin(), I.end()
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define eps 1e-12
#define INF 1000000007
#define MXN 200005
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

char s[MXN];
bool vis[5][5];

int main(){
	scanf("%s", s);
	for(int i = 0; s[i]; i ++){
		bool f = 1;
		if(s[i] == '0'){
			for(int r = 0; r < 3 && f; r ++){
				for(int c = 0; c < 4 && f; c ++){
					if(!vis[r][c] && !vis[r + 1][c]){
						vis[r][c] = vis[r + 1][c] = 1;
						printf("%d %d\n", r + 1, c + 1);
						f = 0;
					}
				}
			}
		} else {
			for(int r = 0; r < 4 && f; r ++){
				for(int c = 0; c < 3 && f; c ++){
					if(!vis[r][c] && !vis[r][c + 1]){
						vis[r][c] = vis[r][c + 1] = 1;
						printf("%d %d\n", r + 1, c + 1);
						f = 0;
					}
				}
			}
		}
		for(int r = 0; r < 4; r ++){
			if(vis[r][0] && vis[r][1] && vis[r][2] && vis[r][3]){
				for(int c = 0; c < 4; c ++) vis[r][c] = 0;
			}
		}
		for(int c = 0; c < 4; c ++){
			if(vis[0][c] && vis[1][c] && vis[2][c] && vis[3][c]){
				for(int r = 0; r < 4; r ++) vis[r][c] = 0;
			}
		}
	}
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> opset;
#define SZ(X) ((int)X.size())
#define ALL(I) I.begin(), I.end()
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define eps 1e-12
#define INF 1000000007
#define MXN 200005
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

char s[MXN];
int v, h;

int main(){
	scanf("%s", s);
	for(int i = 0; s[i]; i ++){
		if(s[i] == '0'){
			if(h == 0) puts("1 1");
			if(h == 1) puts("3 1");
			h = (h + 1) % 2;
		} else {
			if(v == 0) puts("4 3");
			if(v == 1) puts("4 1");
			v = (v + 1) % 2;
		}
	}
}


/*Allah vorosha*/
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define n_p next_permutation
#define p_p prev_permutation
#define in insert
#define rev reverse
#define pf push_front
#define pob pop_back
#define uniq(v)			v.resize(distance(v.begin(),unique(v.begin(),v.end())))
#define all(x) (x).begin(),(x).end()
#define pof pop_front
#define ios ios_base::sync_with_stdio(0);cin.tie();cout.tie();
#define scn scanf
#define prt printf
#define rep(i, a, n) for(int i = a; i < n; i++)
#define mod 1000000007
#define yes cout << "YES\n"
#define no cout << "NO\n";
#define take for(auto &it : a) cin >> it;
#define out cout << a << "\n";
#define l_b lower_bound
#define u_b upper_bound
#define f first
#define s second
#define Max 100005

using namespace std;

int main()
{
    string s;
    cin >> s;
    int r1 = 1, c1 = 1, r2 = 3, c2 = 1;
    int n = s.size() - 1;
    for(int i = 0; i <= n; i++) {
        if(s[i] == '0') {
            if(c1 == 5) {
                cout << r1 << " " << 1 << "\n"; c1 = 2;
            }
            else {
                cout << r1 << " " << c1 << "\n"; c1++;
            }
        }
        else {
            if(c2 == 3) {
                printf("%d %d\n", r2, c2);
                c2 = 1;
            }
            else {
                printf("%d %d\n", r2, c2);
                c2 += 2;
            }
        }
    }
    return 0;
}


/*Allah vorosha*/
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define n_p next_permutation
#define p_p prev_permutation
#define in insert
#define rev reverse
#define pf push_front
#define pob pop_back
#define uniq(v)			v.resize(distance(v.begin(),unique(v.begin(),v.end())))
#define all(x) (x).begin(),(x).end()
#define pof pop_front
#define ios ios_base::sync_with_stdio(0);cin.tie();cout.tie();
#define scn scanf
#define prt printf
#define rep(i, a, n) for(int i = a; i < n; i++)
#define mod 1000000007
#define yes cout << "YES\n"
#define no cout << "NO\n";
#define take for(auto &it : a) cin >> it;
#define out cout << a << "\n";
#define l_b lower_bound
#define u_b upper_bound
#define f first
#define s second
#define Max 100005

using namespace std;

int main()
{
    string s;
    cin >> s;
    int r1 = 1, c1 = 1, r2 = 3, c2 = 1;
    int n = s.size() - 1;
    for(int i = 0; i <= n; i++) {
        if(s[i] == '0') {
            if(c1 == 5) {
                cout << r1 << " " << 1 << "\n"; c1 = 1;
            }
            else {
                cout << r1 << " " << c1 << "\n"; c1++;
            }
        }
        else {
            if(c2 == 3) {
                printf("%d %d\n", r2, c2);
                c2 = 1;
            }
            else {
                printf("%d %d\n", r2, c2);
                c2 += 2;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair
#define foreach(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define EPS 1e-6
#define INF 1000000010
#define pi acos(-1.0)
#define mod 1000000007
// #define mod 998244353
#define maxn 100060
#define maxk 101
#define maxm 500010
#define maxq 500010
#define inf 1000000000
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

string s;
int a[4][4];
vector<pair<int, int> > ans;

void clear() {
	for (int i = 0; i < 4; ++i)
		if (a[i][0] > 0 && a[i][1] > 0 && a[i][2] > 0 && a[i][3] > 0) {
			a[i][0] = a[i][1] = a[i][2] = a[i][3] = 2;
		}

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

void placeV() {
	for (int i = 0; i < 3; ++i) {
		bool place = false;
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 0 and a[i+1][j] == 0) {
				a[i][j] = 1;
				a[i + 1][j] = 1;
				ans.pb(mp(i, j));
				place = true;
				break;
			}
		if (place) break;
	}
	clear();
}

void placeH() {
	for (int i = 0; i < 4; ++i) {
		bool place = false;
		for (int j = 0; j < 3; ++j)
			if (a[i][j] == 0 && a[i][j+1] == 0) {
				a[i][j] = 1;
				a[i][j+1] = 1;
				ans.pb(mp(i, j));
				place = true;
				break;
			}
		if (place) break;
	}
	clear();
}

int main() {
	cin >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] == '0') {
			placeV();
		} else {
			placeH();
		}
	}
	for (int i = 0; i < s.length(); ++i) {
		cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair
#define foreach(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define EPS 1e-6
#define INF 1000000010
#define pi acos(-1.0)
#define mod 1000000007
// #define mod 998244353
#define maxn 100060
#define maxk 101
#define maxm 500010
#define maxq 500010
#define inf 1000000000
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

string s;
int a[4][4];
vector<pair<int, int> > ans;

void clear() {
	for (int i = 0; i < 4; ++i)
		if (a[i][0] > 0 && a[i][1] > 0 && a[i][2] > 0 && a[i][3] > 0) {
			a[i][0] = a[i][1] = a[i][2] = a[i][3] = 2;
		}
	for (int i = 0; i < 4; ++i)
		if (a[0][i] > 0 && a[1][i] > 0 && a[2][i] > 0 && a[3][i] > 0) {
			a[0][i] = a[1][i] = a[2][i] = a[3][i] = 2;
		}
	for (int i =0 ; i<4; ++i)
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 2) a[i][j] = 0;
}

void placeV() {
	for (int i = 2; i < 3; ++i) {
		bool place = false;
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 0 and a[i+1][j] == 0) {
				a[i][j] = 1;
				a[i + 1][j] = 1;
				ans.pb(mp(i, j));
				place = true;
				break;
			}
		if (place) break;
	}
	clear();
}

void placeH() {
	for (int i = 0; i < 2; ++i) {
		bool place = false;
		for (int j = 0; j < 3; ++j)
			if (a[i][j] == 0 && a[i][j+1] == 0) {
				a[i][j] = 1;
				a[i][j+1] = 1;
				ans.pb(mp(i, j));
				place = true;
				break;
			}
		if (place) break;
	}
	clear();
}

int main() {
	cin >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] == '0') {
			placeV();
		} else {
			placeH();
		}
	}
	for (int i = 0; i < s.length(); ++i) {
		cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair
#define foreach(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define EPS 1e-6
#define INF 1000000010
#define pi acos(-1.0)
#define mod 1000000007
// #define mod 998244353
#define maxn 100060
#define maxk 101
#define maxm 500010
#define maxq 500010
#define inf 1000000000
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

string s;
int a[4][4];
vector<pair<int, int> > ans;

void clear() {
	for (int i = 0; i < 4; ++i)
		if (a[i][0] > 0 && a[i][1] > 0 && a[i][2] > 0 && a[i][3] > 0) {
			a[i][0] = a[i][1] = a[i][2] = a[i][3] = 2;
		}
	for (int i = 0; i < 4; ++i)
		if (a[0][i] > 0 && a[1][i] > 0 && a[2][i] > 0 && a[3][i] > 0) {
			a[0][i] = a[1][i] = a[2][i] = a[3][i] = 2;
		}
	for (int i =0 ; i<4; ++i)
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 2) a[i][j] = 0;
}

bool check() {
	for (int i = 0; i < 4; ++i)
		if (a[i][0] > 0 && a[i][1] > 0 && a[i][2] > 0 && a[i][3] > 0) {
			return true;
		}
	for (int i = 0; i < 4; ++i)
		if (a[0][i] > 0 && a[1][i] > 0 && a[2][i] > 0 && a[3][i] > 0) {
			return true;
		}
	for (int i = 0; i < 4; ++i)
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 0) {
				int d = 0;
				if (i > 0 && a[i-1][j]==0) d++;
				if (i < 3 && a[i+1][j] == 0) d++;
				if (j > 0 && a[i][j-1] == 0) d++;
				if (j < 3 && a[i][j+1] == 0) d++;
				if (d == 0)
					return false;
			}
	return true;
}

void placeV() {
	for (int i = 0; i < 3; ++i) {
		bool place = false;
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 0 and a[i+1][j] == 0) {
				a[i][j] = 1;
				a[i + 1][j] = 1;
				if (check()) {
					ans.pb(mp(i, j));
					place = true;
					break;
				}
				a[i][j] = a[i + 1][j] = 0;
			}
		if (place) break;
	}
	clear();
}

void placeH() {
	for (int i = 0; i < 4; ++i) {
		bool place = false;
		for (int j = 0; j < 3; ++j)
			if (a[i][j] == 0 && a[i][j+1] == 0) {
				a[i][j] = 1;
				a[i][j+1] = 1;
				if (check()) {
					ans.pb(mp(i, j));
					place = true;
					break;
				}
				a[i][j] = a[i][j+1] = 0;
			}
		if (place) break;
	}
	clear();
}

int main() {
	cin >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] == '0') {
			placeV();
		} else {
			placeH();
		}
	}
	for (int i = 0; i < s.length(); ++i) {
		cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair
#define foreach(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++ i)
#define EPS 1e-6
#define INF 1000000010
#define pi acos(-1.0)
#define mod 1000000007
// #define mod 998244353
#define maxn 100060
#define maxk 101
#define maxm 500010
#define maxq 500010
#define inf 1000000000
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

string s;
int a[4][4];
vector<pair<int, int> > ans;

void clear() {
	for (int i = 0; i < 4; ++i)
		if (a[i][0] > 0 && a[i][1] > 0 && a[i][2] > 0 && a[i][3] > 0) {
			a[i][0] = a[i][1] = a[i][2] = a[i][3] = 2;
		}

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

bool check() {
	for (int i = 0; i < 4; ++i)
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 0) {
				int d = 0;
				if (i > 0 && a[i-1][j]==0) d++;
				if (i < 3 && a[i+1][j] == 0) d++;
				if (j > 0 && a[i][j-1] == 0) d++;
				if (j < 3 && a[i][j+1] == 0) d++;
				if (d == 0)
					return false;
			}
	return true;
}

void placeV() {
	for (int i = 0; i < 3; ++i) {
		bool place = false;
		for (int j = 0; j < 4; ++j)
			if (a[i][j] == 0 and a[i+1][j] == 0) {
				a[i][j] = 1;
				a[i + 1][j] = 1;
				if (check()) {
					ans.pb(mp(i, j));
					place = true;
					break;
				}
				a[i][j] = a[i + 1][j] = 0;
			}
		if (place) break;
	}
	clear();
}

void placeH() {
	for (int i = 0; i < 4; ++i) {
		bool place = false;
		for (int j = 0; j < 3; ++j)
			if (a[i][j] == 0 && a[i][j+1] == 0) {
				a[i][j] = 1;
				a[i][j+1] = 1;
				if (check()) {
					ans.pb(mp(i, j));
					place = true;
					break;
				}
				a[i][j] = a[i][j+1] = 0;
			}
		if (place) break;
	}
	clear();
}

int main() {
	cin >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] == '0') {
			placeV();
		} else {
			placeH();
		}
	}
	for (int i = 0; i < s.length(); ++i) {
		cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5;

#define end '\n'
#define ll long long
#define pb push_back
#define re return 0

int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, x, y, z;
string s, t, u, v, w;

int main (){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout<<"1 1\n2 3\n1 4";
}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5;

#define end '\n'
#define ll long long
#define pb push_back
#define re return 0

int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, x, y, z;
string s, t, u, v, w;

int main (){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout<<"1 1\n1 3\n1 4";
}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5;

#define end '\n'
#define ll long long
#define pb push_back
#define re return 0

int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, x, y, z;
string s, t, u, v, w;

int main (){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout<<"1 1\n2 2\n1 4";
}


#include <bits/stdc++.h>
using namespace std;

const int E=1e5+5;

#define end '\n'
#define ll long long
#define pb push_back
#define re return 0

int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, x, y, z;
string s, t, u, v, zero[]={"1 1", "3 1"}, one[]={"1 3", "2 3", "3 3", "4 3"};

int main (){

	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin>>s;
	for (int q=0; q<s.length(); q++){
		if (s[q]=='0'){
			c++;
			cout<<zero[c%2]<<'\n';
		}
		else{
			d++;
			cout<<one[d%4]<<'\n';
		}
	}
}


#include<iostream>
using namespace std;
int main()
{
	string s;
	cin>>s;
//	cout<<s.size()<<endl;
	int v=0,h=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='0')
		{
			v++;
			if(v==1)
			cout<<"1 1\n";
			else
			cout<<"3 1\n",v=0;
		}
		else
		{
			h++;
			cout<<h<<" 2\n";
			if(h==4)
			h=0;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define loop(i,k,n) for(int i=k;i<n;++i)
#define loopr(i,k,n) for (int i=k;i>n;--i)
#define loopeq(i,k,n) for(int i=k;i<=n;++i)
#define loopeqr(i,k,n) for(int i=k;i>=n;--i)
#define  ll long long int
#define M 1000000007
#define ff first
#define ss second
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pb push_back
#define vll vector<ll>
#define vii vector<int>
#define time        cerr << "\nTime elapsed: " << 1000 * clock()
#define N 998244353

int main()
{
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin>>s;
    string vert[2]={"1 4","3 4"};
    string horz[2]={"4 1","4 3"};
    int v=0,h=0;
    loop(i,0,s.size())
    {
        if(s[i]=='0')
        {
            cout<<vert[v%2];
            v++;
        }
        else
        {
            cout<<horz[h%2];
            h++;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define loop(i,k,n) for(int i=k;i<n;++i)
#define loopr(i,k,n) for (int i=k;i>n;--i)
#define loopeq(i,k,n) for(int i=k;i<=n;++i)
#define loopeqr(i,k,n) for(int i=k;i>=n;--i)
#define  ll long long int
#define M 1000000007
#define ff first
#define ss second
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pb push_back
#define vll vector<ll>
#define vii vector<int>
#define time        cerr << "\nTime elapsed: " << 1000 * clock()
#define N 998244353

int main()
{
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin>>s;
    string vert[4]={"1 3","1 4","1 3","1 4"};
    string horz[4]={"1 1","2 1","3 1","4 1"};
    int v=0,h=0;
    loop(i,0,s.size())
    {
        if(s[i]=='0')
        {
            cout<<vert[v%4];
            v++;
        }
        else
        {
            cout<<horz[h%4];
            h++;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define loop(i,k,n) for(int i=k;i<n;++i)
#define loopr(i,k,n) for (int i=k;i>n;--i)
#define loopeq(i,k,n) for(int i=k;i<=n;++i)
#define loopeqr(i,k,n) for(int i=k;i>=n;--i)
#define  ll long long int
#define M 1000000007
#define ff first
#define ss second
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pb push_back
#define vll vector<ll>
#define vii vector<int>
#define time        cerr << "\nTime elapsed: " << 1000 * clock()
#define N 998244353

int main()
{
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin>>s;
    string vert[4]={"1 3","1 4","3 3","3 4"};
    string horz[4]={"1 1","2 1","3 1","4 1"};
    int v=0,h=0;
    loop(i,0,s.size())
    {
        if(s[i]=='0')
        {
            cout<<vert[v%4];
            v++;
        }
        else
        {
            cout<<horz[h%4];
            h++;
        }
        cout<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    string s;
    cin>>s;
    int n=0,m=0;
    cout<<s.length()<<endl;
    for(int i=0;i<s.length();i++){
        if(s[i]=='0'){
            if(n==0){
                cout<<1<<" "<<1<<endl;
                n++;
            }
            else{
                cout<<3<<" "<<1<<endl;
                n=0;
            }
        }
        else{
            if(m<3){
                cout<<m+1<<" "<<3<<endl;
                m++;
            }
            else if(m==3){
                cout<<m+1<<" "<<3<<endl;
                m=0;
            }
        }
    }
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    string s;
    cin>>s;
    int n=0,m=0;
    for(int i=0;i<s.length();i++){
        if(s[i]=='0'){
            if(n==0){
                cout<<1<<" "<<1<<endl;
                n++;
            }
            else{
                cout<<3<<" "<<1<<endl;
                n=0;
            }
        }
        else{
            if(m<=3){
                cout<<m+1<<" "<<3<<endl;
                m++;
            }
            else if(m==4){
                m=0;
            }
        }
    }
}


#include<bits/stdc++.h>

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)

#define ll long long int
#define ld long double

#define fr first
#define se second

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))

#define pb push_back
#define mp make_pair

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b

#define PI 3.141592653589793238

ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}

bool g[11][11];
string s;

void zr(int i){
  for(int j = 1; j <= 4; j++)
    g[i][j] = 0;
}

void zc(int j){
  for(int i = 1; i <= 4; i++)
    g[i][j] = 0;
}

bool fr(int i){
  int cntr = 0;
  for(int j = 1; j <= 4; j++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

bool fc(int j){
  int cntr = 0;
  for(int i = 1; i <= 4; i++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

vector<pair<int, int>>v;

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  //clock_t z = clock();
  cin >> s;
  for(auto c : s){
    bool f = 0;
    if(c == '0'){
      for(int i = 1; i <= 4; i++){
        for(int j = 1; j <= 4; j++){
          if(g[i][j] == 0 && g[i+1][j] == 0 && i <= 3){
            v.pb({i, j});
            g[i][j] = 1;
            g[i+1][j] = 1;
            f = 1;
          }
          if(fc(j))zc(j);
          if(fr(i))zr(i);
          if(f)break;
        }
        if(f)break;
      }
    }
    else if(c == '1'){
      for(int i = 1; i <= 4; i++){
        for(int j = 1; j <= 4; j++){
          if(g[i][j] == 0 && g[i][j+1] == 0 && j <= 3){
            g[i][j] = 1;
            g[i][j+1] = 1;
            v.pb({i, j});
            f = 1;
            break;
          }
          if(fc(j))zc(j);
          if(fr(i))zr(i);
          if(f)break;
        }
        if(f)break;
      }
    }
  }
  //for(int i = 1; i <= 4; i++){
    //  for(int j = 1; j <= 4; j++)
      //  cout << g[i][j];
      //cout << endl;
    //}
  for(auto i : v)cout << i.fr << " " << i.se << endl;
  //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
  /*
  *try tricky test cases:
    -bounds
    -integer overflow
    -small input (0, 1)
    -big input
    -random tests
  */
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)

#define ll long long int
#define ld long double

#define fr first
#define se second

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))

#define pb push_back
#define mp make_pair

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b

#define PI 3.141592653589793238

ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}

bool g[11][11];
string s;

void zr(int i){
  for(int j = 1; j <= 4; j++)
    g[i][j] = 0;
}

void zc(int j){
  for(int i = 1; i <= 4; i++)
    g[i][j] = 0;
}

bool fr(int i){
  int cntr = 0;
  for(int j = 1; j <= 4; j++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

bool fc(int j){
  int cntr = 0;
  for(int i = 1; i <= 4; i++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

vector<pair<int, int>>v;

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  //clock_t z = clock();
  cin >> s;
  for(auto c : s){
    bool f = 0;
    if(c == '0'){
      for(int i = 1; i <= 4; i++){
        for(int j = 1; j <= 4; j++){
          if(g[i][j] == 0 && g[i+1][j] == 0 && i <= 3){
            v.pb({i, j});
            g[i][j] = 1;
            g[i+1][j] = 1;
            f = 1;
          }
          if(fc(j))zc(j);
          if(fr(i))zr(i);
          if(f)break;
        }
        if(f)break;
      }
    }
    else if(c == '1'){
      for(int i = 1; i <= 4; i++){
        for(int j = 1; j <= 4; j++){
          if(g[i][j] == 0 && g[i][j+1] == 0 && j <= 3){
            g[i][j] = 1;
            g[i][j+1] = 1;
            v.pb({i, j});
            f = 1;
            break;
          }
          if(fc(j))zc(j);
          if(fr(i))zr(i);
          if(f)break;
        }
        if(f)break;
      }
    }
  }
  for(int i = 1; i <= 4; i++){
      for(int j = 1; j <= 4; j++)
        cout << g[i][j];
      cout << endl;
    }
  for(auto i : v)cout << i.fr << " " << i.se << endl;
  //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
  /*
  *try tricky test cases:
    -bounds
    -integer overflow
    -small input (0, 1)
    -big input
    -random tests
  */
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)

#define ll long long int
#define ld long double

#define fr first
#define se second

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))

#define pb push_back
#define mp make_pair

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b

#define PI 3.141592653589793238

ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}

bool g[11][11];
string s;

void zr(int i){
  for(int j = 1; j <= 4; j++)
    g[i][j] = 0;
}

void zc(int j){
  for(int i = 1; i <= 4; i++)
    g[i][j] = 0;
}

bool fr(int i){
  int cntr = 0;
  for(int j = 1; j <= 4; j++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

bool fc(int j){
  int cntr = 0;
  for(int i = 1; i <= 4; i++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  //clock_t z = clock();
  cin >> s;
  for(auto c : s){
    for(int i = 1; i <= 4; i++)
      if(fr(i))zr(i);
    for(int j = 1; j <= 4; j++)
      if(fc(j))zc(j);
    if(c == '0'){
      if(g[1][1]){
        cout << 3 << " " << 1 << endl;
        g[3][1] = 1;
        g[4][1] = 1;
      }
      else{
        cout << 1 << " " << 1 << endl;
        g[1][1] = 1;
        g[2][1] = 1;
      }
    }
    else if(c == '1'){
      if(g[4][3] == 0){
        cout << 4 << " " << 3 << endl;
        g[4][3] = 1;
        g[4][4] = 1;
      }
      else if(g[3][3] == 0){
        cout << 3 << " " << 3 << endl;
        g[3][3] = 1;
        g[3][4] = 1;
      }
      else if(g[2][3] == 0){
        cout << 2 << " " << 3 << endl;
        g[2][3] = 1;
        g[2][4] = 1;
      }
      else{
        cout << 1 << " " << 3 << endl;
        g[1][3] = 1;
        g[1][4] = 1;
      }
    }
  }
  //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
  /*
  *try tricky test cases:
    -bounds
    -integer overflow
    -small input (0, 1)
    -big input
    -random tests
  */
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)

#define ll long long int
#define ld long double

#define fr first
#define se second

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))

#define pb push_back
#define mp make_pair

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b

#define PI 3.141592653589793238

ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}

bool g[11][11];
string s;

void zr(int i){
  for(int j = 1; j <= 4; j++)
    g[i][j] = 0;
}

void zc(int j){
  for(int i = 1; i <= 4; i++)
    g[i][j] = 0;
}

bool fr(int i){
  int cntr = 0;
  for(int j = 1; j <= 4; j++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

bool fc(int j){
  int cntr = 0;
  for(int i = 1; i <= 4; i++)
    if(g[i][j])
      cntr++;
  return cntr == 4;
}

vector<pair<int, int>>v;

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  //clock_t z = clock();
  cin >> s;
  for(auto c : s){
    bool f = 0;
    for(int i = 1; i <= 4; i++)
      if(fr(i))zr(i);
    for(int j = 1; j <= 4; j++)
      if(fc(j))zc(j);
    if(c == '0'){
      for(int i = 1; i <= 4; i++){
        for(int j = 1; j <= 4; j++){
          if(g[i][j] == 0 && g[i+1][j] == 0 && i <= 3){
            v.pb({i, j});
            g[i][j] = 1;
            g[i+1][j] = 1;
            f = 1;
          }
          if(fc(j))zc(j);
          if(fr(i))zr(i);
          if(f)break;
        }
        if(f)break;
      }
    }
    else if(c == '1'){
      for(int i = 1; i <= 4; i++){
        for(int j = 1; j <= 4; j++){
          if(g[i][j] == 0 && g[i][j+1] == 0 && j <= 3){
            g[i][j] = 1;
            g[i][j+1] = 1;
            v.pb({i, j});
            f = 1;
            break;
          }
          if(fc(j))zc(j);
          if(fr(i))zr(i);
          if(f)break;
        }
        if(f)break;
      }
    }
  }

  for(auto i : v)cout << i.fr << " " << i.se << endl;
  //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
  /*
  *try tricky test cases:
    -bounds
    -integer overflow
    -small input (0, 1)
    -big input
    -random tests
  */
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x=false,y=false,i;
    string s;
    cin>>s;
    for(i=0;i<s.length();i++)
    if(s[i]=='0')
    {
        if(x)

        cout<<1<<" "<<1<<"\n";
        else
        cout<<3<<" "<<1<<"\n";
        x=!x;
    }
    else
    {
        if(y)

        cout<<1<<" "<<2<<"\n";

        else

        cout<<4<<" "<<2<<"\n";
        y=!y;

    }

return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x=false,y=false,i;
    string s;
    cin>>s;
    for(i=0;i<s.length();i++)
    if(s[i]=='0')
    {
        if(x)

        cout<<3<<" "<<1<<"\n";
        else
        cout<<1<<" "<<1<<"\n";
        x=!x;
    }
    else
    {
        if(y)

        cout<<4<<" "<<1<<"\n";

        else

        cout<<4<<" "<<3<<"\n";
        y=!y;

    }

return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x=false,y=false,i;
    string s;
    cin>>s;
    for(i=0;i<s.length();i++)
    if(s[i]=='0')
    {
        if(x)

        cout<<1<<" "<<1<<"\n";
        else
        cout<<3<<" "<<1<<"\n";
        x=!x;
    }
    else
    {
        if(y)

        cout<<4<<" "<<1<<"\n";

        else

        cout<<4<<" "<<3<<"\n";
        y=!y;

    }

return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x=false,y=false,i;
    string s;
    cin>>s;
    for(i=0;i<s.length();i++)
    if(s[i]=='0')
    {
        if(x)

        cout<<1<<" "<<1<<"\n";
        else
        cout<<3<<" "<<1<<"\n";
        x=!x;
    }
    else
    {
        if(y)

        cout<<4<<" "<<3<<"\n";

        else

        cout<<4<<" "<<1<<"\n";
        y=!y;

    }

return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x=false,y=false,i;
    string s;
    cin>>s;
    for(i=0;i<s.length();i++)
    if(s[i]=='0')
    {
        if(x)

        cout<<1<<" "<<1<<"\n";
        else
        cout<<3<<" "<<3<<"\n";
        x=!x;
    }
    else
    {
        if(y)

        cout<<1<<" "<<2<<"\n";

        else

        cout<<4<<" "<<2<<"\n";
        y=!y;

    }

return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>

using namespace std;
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i != (n); i++)
#define fi first
#define se second
#define pb push_back
#define sz size()

int a[5][5];

void clear()
{
    vector<int> r, c;
    for (int i = 0; i < 4; i++)
    {
        int t = 1;
        for (int j = 0; j < 4; j++)
        {
            if (a[i][j] == 1)
                t = 0;
        }
        if (t == 1)
            r.push_back(i);
    }
    for (int j = 0; j < 4; j++)
    {
        int t = 1;
        for (int i = 0; i < 4; i++)
        {
            if (a[i][j] == 1)
                t = 0;
        }
        if (t)
            c.push_back(j);
    }
    for (int i = 0; i < r.sz; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            a[r[i]][j] = 0;
        }
    }
    for (int i = 0; i < c.sz; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            a[j][c[i]] = 0;
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0')
        {
            int t = 0;
            for (int x = 0; x < 4; x += 2)
            {
                for (int y = 0; y < 4; y++)
                {
                    if (t == 0 && a[x][y] == 0 && a[x + 1][y] == 0)
                    {
                        a[x][y] = 1;
                        a[x + 1][y] = 1;
                        cout << x + 1 << " " << y + 1 << endl;
                        t = 1;
                        clear();
                    }
                }
            }
        }
        else
        {
            int t = 0;
            for (int x = 0; x < 4; x++)
            {
                for (int y = 0; y < 4; y+=2)
                {
                    if (t == 0 && a[x][y] == 0 && a[x][y + 1] == 0)
                    {
                        a[x][y] = 1;
                        a[x][y + 1] = 1;
                        cout << x + 1 << " " << y + 1 << endl;
                        t = 1;
                        clear();
                    }
                }
            }
        }
    }
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>

using namespace std;
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i != (n); i++)
#define fi first
#define se second
#define pb push_back
#define sz size()

int a[5][5];

void clear()
{
    vector<int> r, c;
    for (int i = 0; i < 4; i++)
    {
        int t = 1;
        for (int j = 0; j < 4; j++)
        {
            if (a[i][j] == 1)
                t = 0;
        }
        if (t == 1)
            r.push_back(i);
    }
    for (int j = 0; j < 4; j++)
    {
        int t = 1;
        for (int i = 0; i < 4; i++)
        {
            if (a[i][j] == 1)
                t = 0;
        }
        if (t)
            c.push_back(j);
    }
    for (int i = 0; i < r.sz; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            a[r[i]][j] = 0;
        }
    }
    for (int i = 0; i < c.sz; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            a[j][c[i]] = 0;
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0')
        {
            int t = 0;
            for (int x = 0; x < 4; x += 2)
            {
                for (int y = 0; y < 4; y += 2)
                {
                    if (t == 0 && a[x][y] == 0 && a[x + 1][y] == 0)
                    {
                        a[x][y] = 1;
                        a[x + 1][y] = 1;
                        cout << x + 1 << " " << y + 1 << endl;
                        t = 1;
                        clear();
                    }
                    if (t == 0 && a[x][y] == 1 && a[x + 1][y] == 1)
                    {
                        if (a[x][y + 1] == 0 && a[x + 1][y + 1] == 0)
                        {
                            a[x][y + 1] = 1;
                            a[x + 1][y + 1] = 1;
                            cout << x + 1 << " " << y + 2 << endl;
                            t = 1;
                            clear();
                        }
                    }
                }
            }
            for (int x = 0; x < 4; x += 2)
            {
                for (int y = 1; y < 4; y += 2)
                {
                    if (t == 0 && a[x][y] == 0 && a[x + 1][y] == 0)
                    {
                        a[x][y] = 1;
                        a[x + 1][y] = 1;
                        cout << x + 1 << " " << y + 1 << endl;
                        t = 1;
                        clear();
                    }
                }
            }
        }
        else
        {
            int t = 0;
            for (int x = 0; x < 4; x+=2)
            {
                for (int y = 0; y < 4; y+=2)
                {
                    if (t == 0 && a[x][y] == 0 && a[x][y + 1] == 0)
                    {
                        a[x][y] = 1;
                        a[x][y + 1] = 1;
                        cout << x + 1 << " " << y + 1 << endl;
                        t = 1;
                        clear();
                    }
                    if (t == 0 && a[x][y] == 1 && a[x][y + 1] == 1)
                    {
                        if (a[x + 1][y] == 0 && a[x + 1][y + 1] == 0)
                        {
                            a[x + 1][y] = 1;
                            a[x + 1][y + 1] = 1;
                            cout << x + 2 << " " << y + 1 << endl;
                            t = 1;
                            clear();
                        }
                    }
                }
            }
            for (int x = 1; x < 4; x+=2)
            {
                for (int y = 0; y < 4; y+=2)
                {
                    if (t == 0 && a[x][y] == 0 && a[x][y + 1] == 0)
                    {
                        a[x][y] = 1;
                        a[x][y + 1] = 1;
                        cout << x + 1 << " " << y + 1 << endl;
                        t = 1;
                        clear();
                    }
                }
            }
        }
    }
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>

using namespace std;
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i != (n); i++)
#define fi first
#define se second
#define pb push_back
#define sz size()

int a[5][5];

void clear()
{
    vector<int> r, c;
    for (int i = 0; i < 4; i++)
    {
        int t = 1;
        for (int j = 0; j < 4; j++)
        {
            if (a[i][j] == 1)
                t = 0;
        }
        if (t == 1)
            r.push_back(i);
    }
    for (int j = 0; j < 4; j++)
    {
        int t = 1;
        for (int i = 0; i < 4; i++)
        {
            if (a[i][j] == 1)
                t = 0;
        }
        if (t)
            c.push_back(j);
    }
    for (int i = 0; i < r.sz; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            a[r[i]][j] = 0;
        }
    }
    for (int i = 0; i < c.sz; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            a[j][c[i]] = 0;
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0')
        {
            if (a[0][0] == 0)
            {
                cout << "1 1\n";
                a[0][0] = 1;
                a[1][0] = 1;
            }
            else
            {
                cout << "3 1\n";
                a[2][0] = 1;
                a[3][0] = 1;
                clear();
            }
        }
        else
        {
            for (int i = 0; i < 4; i++)
            {
                if (a[i][1] == 0)
                {
                    a[i][1] = 1;
                    a[i][2] = 1;
                    cout << i + 1 << " 2\n";
                    clear();
                    break;
                }
            }
        }
    }
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>

using namespace std;
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i != (n); i++)
#define fi first
#define se second
#define pb push_back
#define sz size()

int a[5][5];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '0')
        {
            if (a[0][0] == 0)
            {
                cout << "1 1\n";
                a[0][0] = 1;
                a[1][0] = 1;
            }
            else
            {
                cout << "3 1\n";
                a[0][0] = 0;
                a[1][0] = 0;
            }
        }
        else
        {
            for (int i = 0; i < 4; i++)
            {
                if (a[i][1] == 0)
                {
                    a[i][1] = 1;
                    a[i][2] = 1;
                    cout << i + 1 << " 2\n";
                    if (i == 3)
                    {
                        for (int j = 0; j < 4; j++)
                        {
                            a[j][1] = 0;
                            a[j][2] = 0;
                        }
                    }
                    break;
                }
            }
        }
    }
}


// by VIDIT BHARDWAJ
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pbds;

#define int                     long long int
#define pb                      push_back
#define mk(arr,n,type)          type *arr=new type[n]; //mk(pos,n,vector<int>)
#define setbits(x)              __builtin_popcountll(x)
#define zerobits(x)             __builtin_ctzll(x)
#define ps(x,y)                 fixed<<setprecision(y)<<x // cout<<ps(1.255114,4)
#define tc(t)                   int t; cin>>t; while(t--)
#define ios                     ios_base::sync_with_stdio(false);cin.tie(NULL);

const long long mod=1000000007;
const int inf=1000000000000000000;
const long double pi = 3.14159265358979323846264338;

int lcm(int a,int b){
    return (a*b)/__gcd(a,b);
}
bool 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;
}
// Fermat's little theorem
int pow(int a, unsigned int b,int mod1){
    int ans=1;
    while(b){
        if(b&1ll){
            ans*=a;
            ans%=mod1;
        }
        b/=2;
        a*=a;
        a%=mod1;
    }
    return ans;
}
int inverse(int a,int mod1){
    return pow(a,mod1-2,mod1);    // a^-1%p
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

signed main(){
    ios
    string str; cin>>str;

    bool x=0,y=0;
    for(int i=0;i<str.size();i++){

        if(str[i]=='0'){

            if(!x){
                cout<<"1 1"<<endl;
            }
            else{
                cout<<"3 1"<<endl;
            }
            x=x-1;
        }
        else{

            if(!y){
                cout<<"3 4"<<endl;
            }
            else{
                cout<<"3 2"<<endl;
            }
            y=y-1;
        }
    }

    return 0;
}

/*

*/


// by VIDIT BHARDWAJ
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pbds;

#define int                     long long int
#define pb                      push_back
#define mk(arr,n,type)          type *arr=new type[n]; //mk(pos,n,vector<int>)
#define setbits(v)              __builtin_popcountll(v)
#define zerobits(v)             __builtin_ctzll(v)
#define ps(v,h)                 fixed<<setprecision(h)<<v // cout<<ps(1.255114,4)
#define tc(t)                   int t; cin>>t; while(t--)
#define ios                     ios_base::sync_with_stdio(false);cin.tie(NULL);

const long long mod=1000000007;
const int inf=1000000000000000000;
const long double pi = 3.14159265358979323846264338;

int lcm(int a,int b){
    return (a*b)/__gcd(a,b);
}
bool 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;
}
// Fermat's little theorem
int pow(int a, unsigned int b,int mod1){
    int ans=1;
    while(b){
        if(b&1ll){
            ans*=a;
            ans%=mod1;
        }
        b/=2;
        a*=a;
        a%=mod1;
    }
    return ans;
}
int inverse(int a,int mod1){
    return pow(a,mod1-2,mod1);    // a^-1%p
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

signed main(){
    ios
    string str; cin>>str;

    bool v=0,h=0;
    for(int i=0;i<str.size();i++){

        if(str[i]=='0'){

            if(!v){
                cout<<"1 1"<<endl;
            }
            else{
                cout<<"3 1"<<endl;
            }
            v=v-1;
        }
        else{

            if(!h){
                cout<<"3 3"<<endl;
            }
            else{
                cout<<"3 1"<<endl;
            }
            h=h-1;
        }
    }

    return 0;
}

/*

*/


#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	string s;
	cin >> s;
	for (auto i : s) {
		if (i == '1') {
			cout << 3 << " " << ++N << endl;
			N %=4;
		}
		else {
			cout << 1 << " " << M + 1 << endl;
			M += 2;
			M %= 4;
		}
	}
	return 0;
}


#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	string s;
	cin >> s;
	for (auto i : s) {
		if (i == '1') {
			cout << ++N << " " << 3 << endl;
			N %=4;
		}
		else {
			cout << 1 +M<< " " <<  1 << endl;
			M += 2;
			M %= 4;
		}
	}
	return 0;
}


#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	string s;
	cin >> s;
	for (auto i : s) {
		if (i == '1') {
			cout << 3 << " " << ++N << endl;
			N %=4;
		}
		else {
			cout << 1 << " " << M + 2 << endl;
			M += 2;
			M %= 4;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string S;

void solve() {
	int i,j,k,l,r,x,y; string s;

	cin>>S;
	int a=0,b=0;
	FORR(c,S) {
		if(c=='0') {
			cout<<"1"<<" "<<a+1<<endl;
			a++;
			if(a==4) a=0;
		}
		else {
			cout<<"4"<<" "<<b+1<<endl;
			b+=2;
			if(b==4) b=0;
		}
	}

}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string S;

void solve() {
	int i,j,k,l,r,x,y; string s;

	cin>>S;
	int a=0,b=0;
	FORR(c,S) {
		if(c=='0') {
			cout<<"1"<<" "<<a+1<<endl;
			a++;
			if(a==4) a=0;
		}
		else {
			cout<<"3"<<" "<<a+1<<endl;
			a+=2;
			if(a==4) a=0;
		}
	}

}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string S;

void solve() {
	int i,j,k,l,r,x,y; string s;

	cin>>S;
	int a=0,b=0;
	FORR(c,S) {
		if(c=='0') {
			cout<<"1"<<" "<<a+1<<endl;
			a++;
			if(a==4) a=0;
		}
		else {
			cout<<"4"<<" "<<a+1<<endl;
			a+=2;
			if(a==4) a=0;
		}
	}

}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


#include <bits/stdc++.h>
#ifdef TOPOLOGY
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin >> s;
	int rs = 0, cs = 0;
	for (int i = 0; i < (int)s.size(); i++) {
		if (s[i] == '0') {
			rs++;
			if (rs & 1) cout << "1 1" << '\n';
			else cout << "1 3" << '\n';
		} else {
			cs++;
			if (cs & 1) cout << "4 4" << '\n';
			else cout << "2 4" << '\n';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#ifdef TOPOLOGY
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin >> s;
	int rs = 0, cs = 0;
	for (int i = 0; i < (int)s.size(); i++) {
		if (s[i] == '0') {
			rs++;
			if (rs & 1) cout << "1 1" << '\n';
			else cout << "1 3" << '\n';
		} else {
			cs++;
			if (cs & 1) cout << "3 4" << '\n';
			else cout << "1 4" << '\n';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#ifdef TOPOLOGY
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin >> s;
	int rs = 0, cs = 0;
	for (int i = 0; i < (int)s.size(); i++) {
		if (s[i] == '0') {
			rs++;
			if (rs & 1) cout << "1 1" << '\n';
			else cout << "3 1" << '\n';
		} else {
			cs++;
			if (cs & 1) cout << "4 3" << '\n';
			else cout << "4 1" << '\n';
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
string s;
int v, h;
int main()
{
    cin >> s;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]=='0')
        {
            if(v==0)
                cout << "1 1" << endl;
            if(v==1)
                cout << "3 1" << endl;
            v++;
            if(h==2)
                h=0;
        }
        else
        {
            if(h==0)
                cout << "4 3" << endl;
            if(h==1)
                cout << "4 1" << endl;
            h++;
            if(h==2)
                h=0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
string s;
int v, h;
int main()
{
    cin >> s;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]=='0')
        {
            if(v==0)
                cout << "1 1" << endl;
            if(v==1)
                cout << "3 1" << endl;
            v++;
            if(v==2)
                v=0;
        }
        else
        {
            if(h==0)
                cout << "4 3" << endl;
            if(h==1)
                cout << "4 1" << endl;
            h++;
            if(h==2)
                h=0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
string s;
int v, h;
int main()
{
    cin >> s;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]=='0')
        {
            if(v==0)
                cout << "1 1" << endl;
            if(v==1)
                cout << "3 1" << endl;
            v++;
            if(v==2)
                h=0;
        }
        else
        {
            if(h==0)
                cout << "4 3" << endl;
            if(h==1)
                cout << "4 1" << endl;
            h++;
            if(h==2)
                h=0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) begin(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define rep(i, x, n) for (ll i = x; i < n; i++)
#define fastio() ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0)
#define endl '\n'

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;

template <class T> inline T RD(T &a) {T x; cin >> x; return a = x;}
template <class T> T gcd(T a, T b) {if (b) return gcd(b, a % b); else return a;}
template <class T> T lcm(T a, T b) {return (a * b) / gcd(a,b);}

signed main()
{
//	freopen("test.inp", "r", stdin); //freopen("TEXT.out", "w", stdout);
	fastio();

	bool zero = false, one = false;

    string s; cin >> s;
    for (char c : s) {
        if (c == '1') {
            if (one) {
                cout << "3 4\n";
            } else {
                cout << "1 4\n";
            }
            one = !one;
        } else {
            if (zero) {
                cout << "4 3\n";
            } else {
                cout << "4 1\n";
            }
            zero = !zero;
        }
    }
}


#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) begin(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define rep(i, x, n) for (ll i = x; i < n; i++)
#define fastio() ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0)
#define endl '\n'

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;

template <class T> inline T RD(T &a) {T x; cin >> x; return a = x;}
template <class T> T gcd(T a, T b) {if (b) return gcd(b, a % b); else return a;}
template <class T> T lcm(T a, T b) {return (a * b) / gcd(a,b);}

signed main()
{
//	freopen("test.inp", "r", stdin); //freopen("TEXT.out", "w", stdout);
	fastio();

	bool zero = false, one = false;

    deque<ii> Z, O;
    Z.push_back({1, 1}), Z.push_back({1, 2}), Z.push_back({3, 1}), Z.push_back({3, 2});
    O.push_back({1, 3}), O.push_back({2, 3}), O.push_back({3, 3}), O.push_back({4, 3});

    string s; cin >> s;
    for (char c : s) {
        if (c == '0') {
            cout << Z.front().fi << ' ' << Z.front().se << endl;
            Z.pb(Z.front());
            Z.pop_front();
        } else {
            cout << O.front().fi << ' ' << O.front().se << endl;
            O.pb(O.front());
            O.pop_front();
        }
    }
}


#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) begin(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define rep(i, x, n) for (ll i = x; i < n; i++)
#define fastio() ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0)
#define endl '\n'

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;

template <class T> inline T RD(T &a) {T x; cin >> x; return a = x;}
template <class T> T gcd(T a, T b) {if (b) return gcd(b, a % b); else return a;}
template <class T> T lcm(T a, T b) {return (a * b) / gcd(a,b);}

signed main()
{
//	freopen("test.inp", "r", stdin); //freopen("TEXT.out", "w", stdout);
	fastio();

	bool zero = false, one = false;

    deque<ii> Z, O;
    Z.push_back({1, 1}), Z.push_back({3, 1});
    O.push_back({1, 3}), O.push_back({2, 3}), O.push_back({3, 3}), O.push_back({4, 3});

    string s; cin >> s;
    for (char c : s) {
        if (c == '0') {
            cout << Z.front().fi << ' ' << Z.front().se << endl;
            Z.pb(Z.front());
            Z.pop_front();
        } else {
            cout << O.front().fi << ' ' << O.front().se << endl;
            O.pb(O.front());
            O.pop_front();
        }
    }
}


#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
  string s;
  cin>>s;

  char c[5][5];
  for(ll i=0;i<4;i++)
  {
      for(ll j=0;j<4;j++)
      c[i][j]='*';
  }

  for(ll k=0;k<s.size();k++)
  {
      ll a,b;

      for(ll i=0;i<4;i++)
      {
          bool f=false;
          for(ll j=0;j<4;j++)
          {
              if(s[k]=='0'){
                  if(i+1<4&&c[i][j]=='*'&&c[i+1][j]=='*')
                  {
                      a=i+1;
                      b=j+1;
                     // cout<<j<<endl;
                      c[i][j]='#';
                      c[i+1][j]='#';
                      f=true;
                      break;
                  }
              }
              else{
                  if(j+1<4&&c[i][j]=='*'&&c[i][j+1]=='*')
                  {
                      a=i+1;
                      b=j+1;
                      c[i][j]='#';
                      c[i][j+1]='#';

                     // cout<<i<<" "<<j<<endl;
                      f=true;
                      break;
                  }
              }
          }

          if(f)
          break;
      }

      vector<ll>r,cc;

      for(ll i=0;i<4;i++)
      {
          ll cnt=0;
          for(ll j=0;j<4;j++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
            r.pb(i);
          }
      }

      for(ll j=0;j<4;j++)
      {
          ll cnt=0;
          for(ll i=0;i<4;i++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
              cc.pb(j);
          }
      }

      for(ll i=0;i<r.size();i++)
      {
          for(ll j=0;j<4;j++)
          c[r[i]][j]='*';
      }

      for(ll i=0;i<cc.size();i++)
      {
          for(ll j=0;j<4;j++)
          {
              c[j][cc[i]]='*';
          }
      }

      cout<<a<<" "<<b<<endl;
  }
}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
  string s;
  cin>>s;

  char c[5][5];
  for(ll i=0;i<5;i++)
  {
      for(ll j=0;j<5;j++)
      c[i][j]='*';
  }

  for(ll k=0;k<s.size();k++)
  {
      ll a,b;

      for(ll i=0;i<4;i++)
      {
          bool f=false;
          for(ll j=0;j<4;j++)
          {
              if(s[k]=='0'){
                  if(i+1<4&&c[i][j]=='*'&&c[i+1][j]=='*')
                  {
                      a=i+1;
                      b=j+1;
                     // cout<<j<<endl;
                      c[i][j]='#';
                      c[i+1][j]='#';
                      f=true;
                      break;
                  }
              }
              else{
                  if(j+1<4&&c[i][j]=='*'&&c[i][j+1]=='*')
                  {
                      a=i+1;
                      b=j+1;
                      c[i][j]='#';
                      c[i][j+1]='#';

                     // cout<<i<<" "<<j<<endl;
                      f=true;
                      break;
                  }
              }
          }

          if(f)
          break;
      }

      for(ll i=0;i<4;i++)
      {
          ll cnt=0;
          for(ll j=0;j<4;j++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
              for(ll j=0;j<4;j++)
              c[i][j]='*';
          }
      }

      for(ll j=0;j<4;j++)
      {
          ll cnt=0;
          for(ll i=0;i<4;i++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
              for(ll i=0;i<4;i++)
              c[i][j]='*';
          }
      }

      cout<<a<<" "<<b<<endl;
  }
}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
  string s;
  cin>>s;

  char c[5][5];
  for(ll i=0;i<4;i++)
  {
      for(ll j=0;j<4;j++)
      c[i][j]='*';
  }

  for(ll i=0;i<s.size();i++)
  {
      if(s[i]=='0'){
         if(c[2][0]=='*'){
             cout<<"3 1"<<endl;
             c[2][0]=c[3][0]='#';
         }
         else
         {
             cout<<"1 1\n";
             c[2][0]=c[3][0]='*';
         }
      }
      else{
           if(c[0][2]=='*'){
             cout<<"1 3"<<endl;
             c[0][2]=c[0][3]='#';
         }
         else
         {
             cout<<"1 1\n";
             c[0][2]=c[0][3]='*';
         }
      }
  }
}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
  string s;
  cin>>s;

  char c[5][5];
  for(ll i=0;i<5;i++)
  {
      for(ll j=0;j<5;j++)
      c[i][j]='*';
  }

  for(ll k=0;k<s.size();k++)
  {
      ll a,b;

      for(ll i=0;i<4;i++)
      {
          bool f=false;
          for(ll j=0;j<4;j++)
          {
              if(s[k]=='0'){
                  if(i+1<4&&c[i][j]=='*'&&c[i+1][j]=='*')
                  {
                      a=i+1;
                      b=j+1;
                     // cout<<j<<endl;
                      c[i][j]='#';
                      c[i+1][j]='#';
                      f=true;
                      break;
                  }
              }
              else{
                  if(j+1<4&&c[i][j]=='*'&&c[i][j+1]=='*')
                  {
                      a=i+1;
                      b=j+1;
                      c[i][j]='#';
                      c[i][j+1]='#';

                     // cout<<i<<" "<<j<<endl;
                      f=true;
                      break;
                  }
              }
          }

          if(f)
          break;
      }

      vector<ll>r,cc;

      for(ll i=0;i<4;i++)
      {
          ll cnt=0;
          for(ll j=0;j<4;j++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
            r.pb(i);
          }
      }

      for(ll j=0;j<4;j++)
      {
          ll cnt=0;
          for(ll i=0;i<4;i++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
              cc.pb(j);
          }
      }

      for(ll i=0;i<r.size();i++)
      {
          for(ll j=0;j<4;j++)
          c[r[i]][j]='*';
      }

      for(ll i=0;i<cc.size();i++)
      {
          for(ll j=0;j<4;j++)
          {
              c[j][cc[i]]='*';
          }
      }

      cout<<a<<" "<<b<<endl;
  }
}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
  string s;
  cin>>s;

  char c[5][5];
  for(ll i=0;i<5;i++)
  {
      for(ll j=0;j<5;j++)
      c[i][j]='*';
  }

  for(ll i=0;i<s.size();i++)
  {
      ll a,b;

      if(s[i]=='0')
      {
        for(ll i=0;i<3;i++)
      {
          bool f=false;
          for(ll j=0;j<4;j++)
          {
              if(c[i][j]=='*'&&c[i+1][j]=='*')
              {
                a=i+1;
                b=j+1;
                c[i][j]='#';
                c[i+1][j]='#';
                f=true;
                break;
              }
          }
          if(f)
          break;
      }
      }
      else
      {
           for(ll j=0;j<3;j++)
      {
          bool f=false;
          for(ll i=0;i<4;i++)
          {
              if(c[i][j]=='*'&&c[i][j+1]=='*')
              {
                a=i+1;
                b=j+1;
                c[i][j]='#';
                c[i][j+1]='#';
                f=true;
                break;
              }
          }
          if(f)
          break;
      }
      }

      for(ll i=0;i<4;i++)
      {
          ll cnt=0;
          for(ll j=0;j<4;j++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
              for(ll j=0;j<4;j++)
              c[i][j]='*';
          }
      }

      for(ll j=0;j<4;j++)
      {
          ll cnt=0;
          for(ll i=0;i<4;i++)
          if(c[i][j]=='#')
          cnt++;

          if(cnt==4)
          {
              for(ll i=0;i<4;i++)
              c[i][j]='*';
          }
      }

      cout<<a<<" "<<b<<endl;
  }
}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
using namespace std;
#define debug(a) cout<<a<<endl
#define clr(a) memset(a,0,sizeof(a))
#define clrne(a) memset(a,-1,sizeof(a))
#define clrinf(a) memset(a,0x3f,sizeof(a))
#define clrneinf(a) memset(a,0xc0,sizeof(a))
const ll mod = 1000000007;
#define eps 1e-9
#define inf 0x3f3f3f3f
#define maxn 10000

char s[maxn];

int main() {
    int a, b;
    a = b = 0;
    scanf("%s", s);
    int len = strlen(s);
    for (int i = 0; i < len; i++) {
        if (s[i] == '1') {
            b++;
            printf("3 %d\n", b);
            b %= 4;
        } else {
            a++;
            printf("1 %d\n", a * 2 - 1);
            a %= 2;
        }
    }
    return 0;
}

/*
304250263527210 10000
*/


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
using namespace std;
#define debug(a) cout<<a<<endl
#define clr(a) memset(a,0,sizeof(a))
#define clrne(a) memset(a,-1,sizeof(a))
#define clrinf(a) memset(a,0x3f,sizeof(a))
#define clrneinf(a) memset(a,0xc0,sizeof(a))
const ll mod = 1000000007;
#define eps 1e-9
#define inf 0x3f3f3f3f
#define maxn 10000

char s[maxn];

int main() {
    int a, b;
    a = b = 0;
    scanf(" %s", s);
    int len = strlen(s);
    for (int i = 0; i < len; i++) {
        if (s[i] == '0') {
            b++;
            printf("3 %d\n", b);
            b %= 4;
        } else {
            a++;
            printf("1 %d\n", a * 2 - 1);
            a %= 2;
        }
    }
    return 0;
}

/*
304250263527210 10000
*/


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
using namespace std;
#define debug(a) cout<<a<<endl
#define clr(a) memset(a,0,sizeof(a))
#define clrne(a) memset(a,-1,sizeof(a))
#define clrinf(a) memset(a,0x3f,sizeof(a))
#define clrneinf(a) memset(a,0xc0,sizeof(a))
const ll mod = 1000000007;
#define eps 1e-9
#define inf 0x3f3f3f3f
#define maxn 10000

char s[maxn];

int main() {
    int a, b;
    a = b = 0;
    scanf("%s", s);
    int len = strlen(s);
    for (int i = 0; i < len; i++) {
        if (s[i] == '1') {
            b++;
            printf("3 %d\n", b);
            b %= 4;
        } else {
            a++;
            printf("1 %d\n", a * 2);
            a %= 2;
        }
    }
    return 0;
}

/*
304250263527210 10000
*/


#include<bits/stdc++.h>
#define fill(arr,c) memset(arr,c,sizeof(arr))
#define sortdesc greater<int>()
#define ll long long int
#define f(i,a) for(int i=0;i<a;i++)
#define fo(i,a) for(int i=1;i<=a;i++)
#define foo(i,x,n,c) for(ll i=x;i<n;i+=c)
#define foi(i,x,n,c) for(ll i=x;i>=n;i+=c)
#define fauto(i,m) for(auto i:m)
#define forall(a) for( auto itr=a.begin();itr!=a.end();itr++)
#define ld long double
#define in push_back
#define mll map<ll,ll>
#define mcl map<char,ll>
#define msl map<string,ll>
#define vi vector<int >
#define vl vector<ll >
#define vc vector <char>
#define o(a) cout<<a
#define os(a) cout<<a<<" "
#define en cout<<"\n";
#define testcase ll t ;cin>>t; while(t--)
#define ff first
#define ss second
#define pl pair<ll,ll>
#define pi pair<int,int>
#define all(a) (a).begin(), (a).end()

#define sz(a)  (a).size()
#define prec(n) fixed<<setprecision(n)
#define mp make_pair
#define bitcount  __builtin_popcountll
#define imin o("imin");en;
using namespace std;
bool comp(const pair<int,int> &a , const pair<int,int> &b){
    if(a.first == b.first)  return a.second < b.second;
     return a.first < b.first;
}
bool comps(const pair<int,int> &a , const pair<int,int> &b){
    if(a.second == b.second)  return a.first< b.first;
     return a.second < b.second;
}
void fastio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);

     freopen("output.txt", "w", stdout);
     #endif
     ios_base::sync_with_stdio(false);

}
ll N=1000003;
ll powexp(ll base,ll exp)
{
    ll result=1;
    ll extra=1;
    while(exp>0)
    {
        if(exp&1) extra=(extra*base)%N,exp--;
        else base=(base*base)%N,exp/=2;
    }
    return extra%N;

}
ll dec(string s)
{
	ll ans=0;
	f(i,sz(s))
	{

		if(s[i]=='1')
		ans=(ans+powexp(2,sz(s)-i-1))%N;
	}
	return ans%N;
}
void swap(ll &a,ll &b)
{
	ll temp=a;
	a=b;
	b=temp;
}
int main()
{
string s;
cin>>s;
ll one=0;
ll zero=0;
f(i,sz(s))
{
	if(s[i]=='0')
	{
		one++;
		os(1);os(one);en;
	}
	else
	{
		zero++;
		os(3);o(2*zero-1);en;
	}
	if(one==4)
	one=0;
	if(zero==2)
	zero=0;
}
en;

	return  0;

}


#include<bits/stdc++.h>
#define fill(arr,c) memset(arr,c,sizeof(arr))
#define sortdesc greater<int>()
#define ll long long int
#define f(i,a) for(int i=0;i<a;i++)
#define fo(i,a) for(int i=1;i<=a;i++)
#define foo(i,x,n,c) for(ll i=x;i<n;i+=c)
#define foi(i,x,n,c) for(ll i=x;i>=n;i+=c)
#define fauto(i,m) for(auto i:m)
#define forall(a) for( auto itr=a.begin();itr!=a.end();itr++)
#define ld long double
#define in push_back
#define mll map<ll,ll>
#define mcl map<char,ll>
#define msl map<string,ll>
#define vi vector<int >
#define vl vector<ll >
#define vc vector <char>
#define o(a) cout<<a
#define os(a) cout<<a<<" "
#define en cout<<"\n";
#define testcase ll t ;cin>>t; while(t--)
#define ff first
#define ss second
#define pl pair<ll,ll>
#define pi pair<int,int>
#define all(a) (a).begin(), (a).end()

#define sz(a)  (a).size()
#define prec(n) fixed<<setprecision(n)
#define mp make_pair
#define bitcount  __builtin_popcountll
#define imin o("imin");en;
using namespace std;
bool comp(const pair<int,int> &a , const pair<int,int> &b){
    if(a.first == b.first)  return a.second < b.second;
     return a.first < b.first;
}
bool comps(const pair<int,int> &a , const pair<int,int> &b){
    if(a.second == b.second)  return a.first< b.first;
     return a.second < b.second;
}
void fastio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);

     freopen("output.txt", "w", stdout);
     #endif
     ios_base::sync_with_stdio(false);

}
ll N=1000003;
ll powexp(ll base,ll exp)
{
    ll result=1;
    ll extra=1;
    while(exp>0)
    {
        if(exp&1) extra=(extra*base)%N,exp--;
        else base=(base*base)%N,exp/=2;
    }
    return extra%N;

}
ll dec(string s)
{
	ll ans=0;
	f(i,sz(s))
	{

		if(s[i]=='1')
		ans=(ans+powexp(2,sz(s)-i-1))%N;
	}
	return ans%N;
}
void swap(ll &a,ll &b)
{
	ll temp=a;
	a=b;
	b=temp;
}
int main()
{
string s;
ll one=0;
ll zero=0;
f(i,sz(s))
{
	if(s[i]=='0')
	{
		one++;
		os(1);os(one);en;
	}
	else
	{
		zero++;
		os(3);o(zero);en;
	}
	if(one==4);
	one=0;
	if(zero==2)
	zero=0;
}
en;

	return  0;

}


#include<bits/stdc++.h>
#define fill(arr,c) memset(arr,c,sizeof(arr))
#define sortdesc greater<int>()
#define ll long long int
#define f(i,a) for(int i=0;i<a;i++)
#define fo(i,a) for(int i=1;i<=a;i++)
#define foo(i,x,n,c) for(ll i=x;i<n;i+=c)
#define foi(i,x,n,c) for(ll i=x;i>=n;i+=c)
#define fauto(i,m) for(auto i:m)
#define forall(a) for( auto itr=a.begin();itr!=a.end();itr++)
#define ld long double
#define in push_back
#define mll map<ll,ll>
#define mcl map<char,ll>
#define msl map<string,ll>
#define vi vector<int >
#define vl vector<ll >
#define vc vector <char>
#define o(a) cout<<a
#define os(a) cout<<a<<" "
#define en cout<<"\n";
#define testcase ll t ;cin>>t; while(t--)
#define ff first
#define ss second
#define pl pair<ll,ll>
#define pi pair<int,int>
#define all(a) (a).begin(), (a).end()

#define sz(a)  (a).size()
#define prec(n) fixed<<setprecision(n)
#define mp make_pair
#define bitcount  __builtin_popcountll
#define imin o("imin");en;
using namespace std;
bool comp(const pair<int,int> &a , const pair<int,int> &b){
    if(a.first == b.first)  return a.second < b.second;
     return a.first < b.first;
}
bool comps(const pair<int,int> &a , const pair<int,int> &b){
    if(a.second == b.second)  return a.first< b.first;
     return a.second < b.second;
}
void fastio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);

     freopen("output.txt", "w", stdout);
     #endif
     ios_base::sync_with_stdio(false);

}
ll N=1000003;
ll powexp(ll base,ll exp)
{
    ll result=1;
    ll extra=1;
    while(exp>0)
    {
        if(exp&1) extra=(extra*base)%N,exp--;
        else base=(base*base)%N,exp/=2;
    }
    return extra%N;

}
ll dec(string s)
{
	ll ans=0;
	f(i,sz(s))
	{

		if(s[i]=='1')
		ans=(ans+powexp(2,sz(s)-i-1))%N;
	}
	return ans%N;
}
void swap(ll &a,ll &b)
{
	ll temp=a;
	a=b;
	b=temp;
}
int main()
{
string s;
cin>>s;
ll one=0;
ll zero=0;
f(i,sz(s))
{
	if(s[i]=='0')
	{
		one++;
		os(1);os(one);en;
	}
	else
	{
		zero++;
		os(3);o(zero);en;
	}
	if(one==4);
	one=0;
	if(zero==2)
	zero=0;
}
en;

	return  0;

}


#include<bits/stdc++.h>
#define fill(arr,c) memset(arr,c,sizeof(arr))
#define sortdesc greater<int>()
#define ll long long int
#define f(i,a) for(int i=0;i<a;i++)
#define fo(i,a) for(int i=1;i<=a;i++)
#define foo(i,x,n,c) for(ll i=x;i<n;i+=c)
#define foi(i,x,n,c) for(ll i=x;i>=n;i+=c)
#define fauto(i,m) for(auto i:m)
#define forall(a) for( auto itr=a.begin();itr!=a.end();itr++)
#define ld long double
#define in push_back
#define mll map<ll,ll>
#define mcl map<char,ll>
#define msl map<string,ll>
#define vi vector<int >
#define vl vector<ll >
#define vc vector <char>
#define o(a) cout<<a
#define os(a) cout<<a<<" "
#define en cout<<"\n";
#define testcase ll t ;cin>>t; while(t--)
#define ff first
#define ss second
#define pl pair<ll,ll>
#define pi pair<int,int>
#define all(a) (a).begin(), (a).end()

#define sz(a)  (a).size()
#define prec(n) fixed<<setprecision(n)
#define mp make_pair
#define bitcount  __builtin_popcountll
#define imin o("imin");en;
using namespace std;
bool comp(const pair<int,int> &a , const pair<int,int> &b){
    if(a.first == b.first)  return a.second < b.second;
     return a.first < b.first;
}
bool comps(const pair<int,int> &a , const pair<int,int> &b){
    if(a.second == b.second)  return a.first< b.first;
     return a.second < b.second;
}
void fastio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);

     freopen("output.txt", "w", stdout);
     #endif
     ios_base::sync_with_stdio(false);

}
ll N=1000003;
ll powexp(ll base,ll exp)
{
    ll result=1;
    ll extra=1;
    while(exp>0)
    {
        if(exp&1) extra=(extra*base)%N,exp--;
        else base=(base*base)%N,exp/=2;
    }
    return extra%N;

}
ll dec(string s)
{
	ll ans=0;
	f(i,sz(s))
	{

		if(s[i]=='1')
		ans=(ans+powexp(2,sz(s)-i-1))%N;
	}
	return ans%N;
}
void swap(ll &a,ll &b)
{
	ll temp=a;
	a=b;
	b=temp;
}
int main()
{
string s;
cin>>s;
ll one=0;
ll zero=0;
f(i,sz(s))
{
	if(s[i]=='0')
	{
		one++;
		os(1);os(one);en;
	}
	else
	{
		zero++;
		os(3);o(zero);en;
	}
	if(one==4)
	one=0;
	if(zero==2)
	zero=0;
}
en;

	return  0;

}