stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

#include<string.h>



using namespace std;



int main()

{

    char line[7];

    for(int i=0;i<6;i++)

    {

        cin>>line[i];

        if(i==3)

        {

            if(line[i]!=line[i-1])

            {

               cout<<"No";

               return 0;

            }

        }

        else if(i==5)

        {

            if(line[i]!=line[i-1])

            {

               cout<<"No";

               return 0;

            }

        }

    }

    cout<<"Yes";

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.316912273871252x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:
#include <iostream>

#include <stdlib.h>

#include <string.h>



using namespace std;



int main()

{

    char str[80];

    cin>>str;

    if((str[2]==str[3]) && (str[4]==str[5]))

       cout<<"Yes";

    else

        cout<<"No";



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.279428951579553x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int main()

{

    string s;

    cin >> s;

    if(s[2]==s[3] && s[4]==s[5])

    {

        cout << "Yes" << endl;

    }

    else cout << "No" << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.333045694730859x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

    char S[7];

    cin >> S;

    if(S[2]== S[3]) {

        if(S[4]==S[5]){

       cout << "Yes" << endl;

        }

        else cout << "No" << endl;

     }

    else cout << "No" << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.335555793561552x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define Tayeb ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

typedef long long ll;

using namespace std;

int main()

{

    Tayeb;

    string s;

    cin >> s;



    if(s[2]==s[3]&&s[4]==s[5])

    cout << "Yes\n";

    else

    cout << "No\n";



    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.4073562956677605x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:


#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <chrono>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <iostream>

#include <map>

#include <math.h>

#include <queue>

#include <random>

#include <set>

#include <string>

#include <thread>

#include <unordered_map>

#include <unordered_set>

#include <vector>

#include <stack>



using namespace std;



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

/* Custom function starts here */



/* Custom function ends here: */

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



int main() {





  /* MAIN Code STARTS here: */

    string s;

    cin >> s;

    if(s[2] == s[3] && s[4] == s[5]){

        cout << "Yes" << endl;

    }

    else{

        cout << "No" << endl;

    }

  /* MAIN Code ENDS here: */

 

}

// Faster C++ solution for the same problem (measured speedup: 5.333045694730859x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



string s;

char a, b, c, d;



int main () {

	cin >> s;

	a = s[2];

	b = s[3];

	c = s[4];

	d = s[5];

	if (a==b && c==d){

		cout << "Yes";

	} else {

		cout << "No";

	}

}

// Faster C++ solution for the same problem (measured speedup: 5.32364804526194x):
#include <stdio.h>



int main(){

 char S[10];

 scanf("%s",&S);

 if(S[2]==S[3] && S[4]==S[5]){

 	printf("Yes");

 }

 else {

 	printf("No");

 }

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



string a = "abc";

int cnt[150];

main ()

{

    string s;

    cin >> s;

    int n = s.size();

    s = ' ' + s;

    string ans = s;

    for( int i = 1; i <= n; i++ )

    {

        cnt[s[i]]++;

    }

    if( abs(cnt['a'] - cnt['b'] ) > 1 || abs( cnt['c'] - cnt['b'] ) > 1 || abs( cnt['a'] - cnt['c']) > 1 )

    {

        puts("NO");

        return 0;

    }

    puts("YES");

}


// Faster C++ solution for the same problem (measured speedup: 5.367275885552452x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define fail {puts("NO");return 0;}

#define suc {puts("YES");return 0;}

using namespace std;

int a,b,c;

char ch[100010];



int main()

{

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

	for(int i=0;i<n;i++)

		if(ch[i]=='a')

			a++;

		else if(ch[i]=='b')

			b++;

		else if(ch[i]=='c')

			c++;

	int mn=min(a,min(b,c));

	a-=mn;b-=mn;c-=mn;

	if(a<2&&b<2&&c<2)

		suc

	else

		fail

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int len,a[4],ok = 0;

char s[100010],ch;

int main(){

	scanf("%s",s+1);

	len=strlen(s+1);

	for(int i=1;i<=len;i++){

		if(s[i]=='a') a[1]++; 

		else if(s[i]=='b') a[2]++;

		else a[3]++;

	}

	sort(a+1,a+3+1);

	if(a[1]==a[2]&&a[2]==a[3]) ok=1;

	if((a[1]==(a[2]-1))&&a[2]==a[3]) ok=1;

	if(a[1]==a[2]&&a[2]==a[3]-1) ok=1;

	if(ok) puts("YES");

	else puts("NO");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2533513424772025x):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;



int a[4];

char s[100001];

int main()

{

	scanf("%s",s+1);

	int len=strlen(s+1);

	for(register int i=1;i<=len;i++)

		a[s[i]-'a'+1]++;

	sort(a+1,a+4);

	if(a[3]-a[1]<=1)  printf("YES");

	else  printf("NO");

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;



int n;

char str[100100];

vector<pii> ans;



int main() {

	scanf("%s",str+1);

	n=strlen(str+1);



	if(str[n]=='1' || str[1]=='0') {

		puts("-1");

		return 0;

	}



	int cur=1,c=2;

	for(int i=1;i<=n/2;i++) {

		if(str[n-i]!=str[i]) {

			puts("-1");

			return 0;

		}

		ans.push_back(pii(cur,c));

		if(str[i]=='1') cur=c;

		c++;

	}

	for(;c<=n;c++) ans.push_back(pii(cur,c));



	for(auto &it:ans)

		printf("%d %d\n",it.first,it.second);



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.316844808943827x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<cmath>

#define MN 100005

using namespace std;

char ch[MN];int n;

int main(){

	scanf("%s",ch+1);n=strlen(ch+1);

	for(int i=1,j=n-1;i<=j;i++,j--)if(ch[i]!=ch[j])return 0*puts("-1");

	if(ch[n]=='1'||ch[1]=='0')return 0*puts("-1");	

	int lst=1;

    for(int i=2;i<=n;i++)if(ch[i]=='1'){

		printf("%d %d\n",i,lst);

		for(int j=lst+1;j<i;j++)printf("%d %d\n",i,j);

		lst=i;

    }printf("%d %d\n",n,n-1);

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <cstring>

#include <algorithm>

using namespace std;

const int maxn=1e5+5;

char s[maxn];

vector<int>G[maxn];

int last,len;

void dfs(int rt,int size){

	if (last==len) return;

	last++;

	if (s[size-1]=='1'){

		G[last].push_back(rt);

		dfs(last,size+1);

	}else{

		G[rt].push_back(last);

		dfs(rt,size+1);

	}

}

void dfs1(int rt){

	for (auto i:G[rt]){

		cout << rt << ' ' << i << '\n';

		dfs1(i);

	}

}

int main(){

	scanf("%s",&s);

	len=strlen(s);

	if (s[len-1]=='1'||s[0]=='0'||s[len-2]=='0'){

		cout << -1;

		return 0;

	}

	for (int i=1;i<len-2;i++){

		if (s[i]!=s[len-2-i]){

			cout << -1;

			return 0;

		}

	}

	last=2;

	G[2].push_back(1);

	dfs(2,2);

	dfs1(last);

}

// Faster C++ solution for the same problem (measured speedup: 3.5550252497350754x):
#include<bits/stdc++.h>

using namespace std;

const int N=200200;



void GG(){

	puts("-1");

	exit(0);

}



vector<int> qaq;



void ae(int i,int j){

	printf("%d %d\n",i,j);

}



char s[N];

int main(){

	scanf("%s",s+1);

	int n=strlen(s+1);

	if(s[n]=='1')GG();

	if(s[1]=='0'||s[n-1]=='0')GG();

	for(int i=1;i<=n-1;i++){

		if(s[i]!=s[n-i])GG();

	}



	s[n]=1;



	qaq.push_back(1);

	for(int i=2;i<=n;i++){

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

			qaq.push_back(i);

		}else{

			for(vector<int>::iterator it=qaq.begin();it!=qaq.end();it++){

				ae(*it,i);

			}

			qaq.clear();

			qaq.push_back(i);

		}

	}

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <cstring>

#include <algorithm>

using namespace std;

const int maxn=1e5+5;

char s[maxn];

vector<int>G[maxn];

int last,len;

void dfs(int rt,int size){

	if (last==len) return;

	last++;

	if (s[size-1]=='1'){

		G[last].push_back(rt);

		dfs(last,size+1);

	}else{

		G[rt].push_back(last);

		dfs(rt,size+1);

	}

}

void dfs1(int rt){

	for (auto i:G[rt]){

		cout << rt << ' ' << i << '\n';

		dfs1(i);

	}

}

int main(){

	scanf("%s",&s);

	len=strlen(s);

	if (s[len-1]=='1'||s[0]=='0'||s[len-2]=='0'){

		cout << -1;

		return 0;

	}

	for (int i=1;i<len-2;i++){

		if (s[i]!=s[len-2-i]){

			cout << -1;

			return 0;

		}

	}

	last=2;

	G[2].push_back(1);

	dfs(2,2);

	dfs1(last);

}

// Faster C++ solution for the same problem (measured speedup: 3.582585747093054x):
#include <iostream>

#include <algorithm>

#include <cstdio>

#include <cstring>



const int MAXN = 1e5 + 7;

char s[MAXN];



int main() {

    scanf("%s", s + 1);

    int len = strlen(s + 1);

    if (s[1] == '0' || s[len] == '1') return printf("-1\n"), 0;

    for (int i = 1; i <= len / 2; i++) if (s[i] ^ s[len - i]) return printf("-1\n"), 0;

    int x = 1;

    for (int i = 2; i <= len; i++) {

        printf("%d %d\n", x, i);

        if (s[i - 1] == '1') x = i; 

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <cstring>

#include <algorithm>

using namespace std;

const int maxn=1e5+5;

char s[maxn];

vector<int>G[maxn];

int last,len;

void dfs(int rt,int size){

	if (last==len) return;

	last++;

	if (s[size-1]=='1'){

		G[last].push_back(rt);

		dfs(last,size+1);

	}else{

		G[rt].push_back(last);

		dfs(rt,size+1);

	}

}

void dfs1(int rt){

	for (auto i:G[rt]){

		cout << rt << ' ' << i << '\n';

		dfs1(i);

	}

}

int main(){

	scanf("%s",&s);

	len=strlen(s);

	if (s[len-1]=='1'||s[0]=='0'||s[len-2]=='0'){

		cout << -1;

		return 0;

	}

	for (int i=1;i<len-2;i++){

		if (s[i]!=s[len-2-i]){

			cout << -1;

			return 0;

		}

	}

	last=2;

	G[2].push_back(1);

	dfs(2,2);

	dfs1(last);

}

// Faster C++ solution for the same problem (measured speedup: 3.5570848373540835x):
#include<bits/stdc++.h>

using namespace std;

//#include<ext/rope>

//using namespace __gnu_cxx

//#include<ext/pb_ds/priority_queue.hpp>

//using namespace __gnu_pbds;

#define lowbit(x) (x&-x)

#define pb push_back

#define empb emplace_back

#define all(x) (x).begin(),(x).end()

#define clr(a,b) memset(a,b,sizeof(a))

#define caze(T) for(cin>>T;T;T--)

#define inf (1<<29)

#define Endl ('\n')

#define fi first

#define se second

#define db double

#define ldb long double

#define ll long long

#define pii pair<int,int>

#define pil pair<int,ll>

#define pli pair<ll,int>

#define pll pair<ll,ll>

#define ull unsigned long long

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

inline char nc() {

	#define SZ 1000000

	static char buf[SZ], *p1, *p2;

	return p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++;

}

template<typename T>

inline int scan(T &x) {

	char c, sign=1; 

	while(!isdigit(c=nc())&&c!=EOF)if(c=='-')sign*=-1;

	if(c==EOF) return EOF;

	for(x = 0; isdigit(c); c = nc())

		x = (x<<1) + (x<<3) + (c&15);

	return x *= sign, 1;

}

template<typename T, typename...Args>

inline int scan(T &x, Args&...args) {

	return scan(x), scan(args...);

}

char s[1<<17];

int main()

{

	cin>>s+1;

	int n=strlen(s+1);

	if(s[1]=='0'||s[n]=='1') return 0*puts("-1");

	for(int i=1;i<n;++i)

		if(s[i]!=s[n-i])

			return 0*puts("-1");

	int a=1;

	for(int i=2;i<=n;++i)

	{

		cout<<a<<' '<<i<<Endl;

		if(s[i-1]=='1') a=i;

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



const int maxn = 1e5 + 10;

int cnt, n;

char s[maxn];

vector<int>g[maxn];

bool check()

{

	//n = strlen(s + 1);

	//cout << "!" << endl;

	if(s[1] != '1' || s[n] != '0')

		return 0;

	//cout << "!" << endl;

	int st = 1, ed = n - 1;

	while(st < ed)

	{

		if(s[st] != s[ed])

			return 0;

		st ++; ed --;

	}

	return 1;

}

struct Edge

{

	int u, v;

}e[maxn * 2];

int edge_num;

void dfs(int x, int fa)

{

	for(int i = g[x].size() - 1; i >= 0; i --)

	{

		int to = g[x][i];

		if(to == fa)

			continue;

		e[++ edge_num].u = x;

		e[edge_num].v = to;

		dfs(to, x);

	}

}

int main()

{

	//int n;

	//scanf("%d", &n);

	scanf("%s", s + 1);

	n = strlen(s + 1);

	if(!check())

	{

		cout << -1;

		return 0;

	}

	int op = ++ cnt;

	g[1].push_back(2); g[2].push_back(1);

	op = ++ cnt;

	for(int i = 2; i < n; i ++)

	{

		if(s[i] == '1')

		{

			if(s[i - 1] != '0')

			{

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

			}

			op = cnt;

		}

		else

		{

			if(s[i - 1] == '1')

			{

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

			}

			else

			{

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

			}

		}

	}

	dfs(1, 0);

	for(int i = 1; i < n; i ++)

		printf("%d %d\n", e[i].u, e[i].v);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.5571491060303733x):
#include<bits/stdc++.h>

using namespace std;

//#include<ext/rope>

//using namespace __gnu_cxx

//#include<ext/pb_ds/priority_queue.hpp>

//using namespace __gnu_pbds;

#define lowbit(x) (x&-x)

#define pb push_back

#define empb emplace_back

#define all(x) (x).begin(),(x).end()

#define clr(a,b) memset(a,b,sizeof(a))

#define caze(T) for(cin>>T;T;T--)

#define inf (1<<29)

#define Endl ('\n')

#define fi first

#define se second

#define db double

#define ldb long double

#define ll long long

#define pii pair<int,int>

#define pil pair<int,ll>

#define pli pair<ll,int>

#define pll pair<ll,ll>

#define ull unsigned long long

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

inline char nc() {

	#define SZ 1000000

	static char buf[SZ], *p1, *p2;

	return p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++;

}

template<typename T>

inline int scan(T &x) {

	char c, sign=1; 

	while(!isdigit(c=nc())&&c!=EOF)if(c=='-')sign*=-1;

	if(c==EOF) return EOF;

	for(x = 0; isdigit(c); c = nc())

		x = (x<<1) + (x<<3) + (c&15);

	return x *= sign, 1;

}

template<typename T, typename...Args>

inline int scan(T &x, Args&...args) {

	return scan(x), scan(args...);

}

char s[1<<17];

int main()

{

	cin>>s+1;

	int n=strlen(s+1);

	if(s[1]=='0'||s[n]=='1') return 0*puts("-1");

	for(int i=1;i<n;++i)

		if(s[i]!=s[n-i])

			return 0*puts("-1");

	int a=1;

	for(int i=2;i<=n;++i)

	{

		cout<<a<<' '<<i<<Endl;

		if(s[i-1]=='1') a=i;

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>



#define fi first

#define se second

#define ll long long

#define pb push_back

#define mp make_pair

#define mt make_tuple



using namespace std;



int niz[100010];

vector<int> graf[100010];

vector<pair<int, int>> res;



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    string s;

    cin >> s;

    int n = s.size();

    for(int i = 1; i <= n; i++)

        niz[i] = s[i-1] - '0';

    bool ok = true;

    if(niz[1] == 0 || niz[n] == 1) ok = false;

    for(int i = 1; i <= n/2; i++)

        if(niz[i] != niz[n - i]) {ok = false; break;}



    if(!ok) {cout << -1; return 0;}



    int tr = 1;

    for(int i = 1; i < n; i++)

    {

        res.pb(mp(i+1, tr));



        if(niz[i] == 1)

            tr = i + 1;

    }

    for(int i = 0; i < res.size(); i++)

        cout << res[i].fi << " " << res[i].se << "\n";





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.5994026157996357x):
#include<bits/stdc++.h>

using namespace std;

//#include<ext/rope>

//using namespace __gnu_cxx

//#include<ext/pb_ds/priority_queue.hpp>

//using namespace __gnu_pbds;

#define lowbit(x) (x&-x)

#define pb push_back

#define empb emplace_back

#define all(x) (x).begin(),(x).end()

#define clr(a,b) memset(a,b,sizeof(a))

#define caze(T) for(cin>>T;T;T--)

#define inf (1<<29)

#define Endl ('\n')

#define fi first

#define se second

#define db double

#define ldb long double

#define ll long long

#define pii pair<int,int>

#define pil pair<int,ll>

#define pli pair<ll,int>

#define pll pair<ll,ll>

#define ull unsigned long long

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

inline char nc() {

	#define SZ 1000000

	static char buf[SZ], *p1, *p2;

	return p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++;

}

template<typename T>

inline int scan(T &x) {

	char c, sign=1; 

	while(!isdigit(c=nc())&&c!=EOF)if(c=='-')sign*=-1;

	if(c==EOF) return EOF;

	for(x = 0; isdigit(c); c = nc())

		x = (x<<1) + (x<<3) + (c&15);

	return x *= sign, 1;

}

template<typename T, typename...Args>

inline int scan(T &x, Args&...args) {

	return scan(x), scan(args...);

}

char s[1<<17];

int main()

{

	cin>>s+1;

	int n=strlen(s+1);

	if(s[1]=='0'||s[n]=='1') return 0*puts("-1");

	for(int i=1;i<n;++i)

		if(s[i]!=s[n-i])

			return 0*puts("-1");

	int a=1;

	for(int i=2;i<=n;++i)

	{

		cout<<a<<' '<<i<<Endl;

		if(s[i-1]=='1') a=i;

	}

}
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <cstring>

#include <algorithm>

using namespace std;

const int maxn=1e5+5;

char s[maxn];

vector<int>G[maxn];

int last,len;

void dfs(int rt,int size){

	if (last==len) return;

	last++;

	if (s[size-1]=='1'){

		G[last].push_back(rt);

		dfs(last,size+1);

	}else{

		G[rt].push_back(last);

		dfs(rt,size+1);

	}

}

void dfs1(int rt){

	for (auto i:G[rt]){

		cout << rt << ' ' << i << '\n';

		dfs1(i);

	}

}

int main(){

	scanf("%s",&s);

	len=strlen(s);

	if (s[len-1]=='1'||s[0]=='0'||s[len-2]=='0'){

		cout << -1;

		return 0;

	}

	for (int i=1;i<len-2;i++){

		if (s[i]!=s[len-2-i]){

			cout << -1;

			return 0;

		}

	}

	last=2;

	G[2].push_back(1);

	dfs(2,2);

	dfs1(last);

}

// Faster C++ solution for the same problem (measured speedup: 3.5579231727655976x):
#include <bits/stdc++.h>



using namespace std;



const int maxn = 1e5 + 5;

char s[maxn];

int n;



bool judge() {

	for (int i = 1; i < n; ++i)

		if (s[i] != s[n-i]) return true;

	return false;

}



int main() {

	cin >> (s+1);

	for (n = 1; s[n] != '\0'; ++n);

	--n;

	if (s[n] != '0' || s[1] != '1' || judge()) puts("-1");

	else {

		int root = 1;

		printf("1 2\n");

		for (int i = 2; i < n; ++i) {

			printf("%d %d\n", root, i+1);

			if (s[i] == '1') root = i+1;

		}

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



const int maxn = 1e5 + 10;

int cnt, n;

char s[maxn];

vector<int>g[maxn];

bool check()

{

	//n = strlen(s + 1);

	//cout << "!" << endl;

	if(s[1] != '1' || s[n] != '0')

		return 0;

	//cout << "!" << endl;

	int st = 1, ed = n - 1;

	while(st < ed)

	{

		if(s[st] != s[ed])

			return 0;

		st ++; ed --;

	}

	return 1;

}

struct Edge

{

	int u, v;

}e[maxn * 2];

int edge_num;

void dfs(int x, int fa)

{

	for(int i = g[x].size() - 1; i >= 0; i --)

	{

		int to = g[x][i];

		if(to == fa)

			continue;

		e[++ edge_num].u = x;

		e[edge_num].v = to;

		dfs(to, x);

	}

}

int main()

{

	//int n;

	//scanf("%d", &n);

	scanf("%s", s + 1);

	n = strlen(s + 1);

	if(!check())

	{

		cout << -1;

		return 0;

	}

	int op = ++ cnt;

	g[1].push_back(2); g[2].push_back(1);

	op = ++ cnt;

	for(int i = 2; i < n; i ++)

	{

		if(s[i] == '1')

		{

			if(s[i - 1] != '0')

			{

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

			}

			op = cnt;

		}

		else

		{

			if(s[i - 1] == '1')

			{

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

			}

			else

			{

				++ cnt;

				g[cnt].push_back(op);

				g[op].push_back(cnt);

			}

		}

	}

	dfs(1, 0);

	for(int i = 1; i < n; i ++)

		printf("%d %d\n", e[i].u, e[i].v);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.557987456588759x):
#include <bits/stdc++.h>



using namespace std;



const int maxn = 1e5 + 5;

char s[maxn];

int n;



bool judge() {

	for (int i = 1; i < n; ++i)

		if (s[i] != s[n-i]) return true;

	return false;

}



int main() {

	cin >> (s+1);

	for (n = 1; s[n] != '\0'; ++n);

	--n;

	if (s[n] != '0' || s[1] != '1' || judge()) puts("-1");

	else {

		int root = 1;

		printf("1 2\n");

		for (int i = 2; i < n; ++i) {

			printf("%d %d\n", root, i+1);

			if (s[i] == '1') root = i+1;

		}

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



#define fi first

#define se second

#define ll long long

#define pb push_back

#define mp make_pair

#define mt make_tuple



using namespace std;



int niz[100010];

vector<int> graf[100010];

vector<pair<int, int>> res;



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    string s;

    cin >> s;

    int n = s.size();

    for(int i = 1; i <= n; i++)

        niz[i] = s[i-1] - '0';

    bool ok = true;

    if(niz[1] == 0 || niz[n] == 1) ok = false;

    for(int i = 1; i <= n/2; i++)

        if(niz[i] != niz[n - i]) {ok = false; break;}



    if(!ok) {cout << -1; return 0;}



    int tr = 1;

    for(int i = 1; i < n; i++)

    {

        res.pb(mp(i+1, tr));



        if(niz[i] == 1)

            tr = i + 1;

    }

    for(int i = 0; i < res.size(); i++)

        cout << res[i].fi << " " << res[i].se << "\n";





    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.6002509246848873x):
#include <bits/stdc++.h>



using namespace std;



const int maxn = 1e5 + 5;

char s[maxn];

int n;



bool judge() {

	for (int i = 1; i < n; ++i)

		if (s[i] != s[n-i]) return true;

	return false;

}



int main() {

	cin >> (s+1);

	for (n = 1; s[n] != '\0'; ++n);

	--n;

	if (s[n] != '0' || s[1] != '1' || judge()) puts("-1");

	else {

		int root = 1;

		printf("1 2\n");

		for (int i = 2; i < n; ++i) {

			printf("%d %d\n", root, i+1);

			if (s[i] == '1') root = i+1;

		}

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;



int n;

char str[100100];

vector<pii> ans;



int main() {

	scanf("%s",str+1);

	n=strlen(str+1);



	if(str[n]=='1' || str[1]=='0') {

		puts("-1");

		return 0;

	}



	int cur=1,c=2;

	for(int i=1;i<=n/2;i++) {

		if(str[n-i]!=str[i]) {

			puts("-1");

			return 0;

		}

		ans.push_back(pii(cur,c));

		if(str[i]=='1') cur=c;

		c++;

	}

	for(;c<=n;c++) ans.push_back(pii(cur,c));



	for(auto &it:ans)

		printf("%d %d\n",it.first,it.second);



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.317768754419422x):
#include <cstdio>

#include <cstring>



char arr[100010];

int prv[100010];



int main() {

	scanf("%s", arr + 1);

	int n = strlen(arr + 1);

	if (arr[1] == '0' || arr[n] == '1') {

		puts("-1");

		return 0;

	}

	for (int i = n - 1; i; --i)

		if (arr[i] != arr[n - i]) {

			puts("-1");

			return 0;

		

		}

	int pos = 1;

	for (int i = 2; i < n; ++i)

		if (arr[i] == '1') {

			prv[i] = pos;

			pos = i;

		}

	int ct = 1, pp = n, cur = 1;

	for (int i = pos; i; i = prv[i]) {

		int nx = ct;

		for (int j = i; j < pp; ++j) {

			printf("%d %d\n", cur, ++ct);

		}

		cur = nx + 1;

		pp = i;

	}

	return 0;

}