stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):


#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: */

 

}

// Optimized solution to the same problem (faster):
#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");

 }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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";

	}

}

// Optimized solution to the same problem (faster):
#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");

 }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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");

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
// In the name of God



#include<bits/stdc++.h>



#define F first

#define S second

#define PB push_back

#define sz(s) int((s).size())

#define bit(n,k) (((n)>>(k))&1)



using namespace std;



typedef long long ll;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;



const int maxn=1e5+10,mod=1e9+7;

const ll inf=1e18;



vector<int>v;

vector<pii>ed;



int main(){

    string s;cin>>s;

    int n=sz(s);

    bool yp=s[n-1]=='0';

    yp&=s[0]=='1';

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

	yp&=(s[i]==s[n-i-2]);

    }

    if(!yp){

	return cout<<-1<<endl,0;

    }

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

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

	    v.PB(i+1);

    }

    v.PB(n);

    int nw=1,C=2,SZ=1;

    for(int x:v){

	SZ++;

	int r=C++;

	ed.PB({nw,r});

	nw=r;

	while(SZ<x){

	    ed.PB({nw,C++});

	    SZ++;

	}

    }

    for(pii p:ed){

	cout<<p.F<<" "<<p.S<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

	}

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



string s;

int v = 1;



int main()

{

	cin >> s;

	if(s[s.size() - 1] == '1' || s[0] == '0')

		return cout << -1 , 0;

	for(int i = 0 ; i < s.size() - 1 ; i++)

		if(s[i] != s[s.size() - 2 - i])

			return cout << -1 , 0;

	for(int i = 0 ; i < s.size() - 1 ; i++)

	{

		cout << v << " " << i + 2 << endl;

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

			v = i + 2;

	}

	/*

	if(s[0] == '1' && s[1] == '1')

	{

		for(int i = 1 ; i < s.size() ; i++)

			cout << i << " " << i + 1 << endl;

	}

	else

	{

		for(int i = 2 ; i <= s.size() ; i++)

			cout << 1 << " " << i << endl;

	}*/

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxn = 1e5 + 7;

char s[maxn];

int main(){

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

    int len = strlen(s+1);

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

        printf("-1\n");

        return 0;

    }

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

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

            printf("-1\n");

            return 0;

        }

    }

    int record = -1;

    for(int i = len/2; i >= 1; --i){

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

            record = i;

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

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

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

            }

            break;

        }

    }

    for(int i = record-1; i >= 1; --i){

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

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

            record = i;

        }

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//Copyright(c)2018 Mstdream

#include<bits/stdc++.h>

using namespace std;

const int N=100010;

char s[N];

void add(int x,int y){printf("%d %d\n",x,y);}

int main(){

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

	int n=strlen(s+1);

	for(int i=1;i<=n;i++)s[i]-='0';

	bool flag=1;

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

	for(int i=1;i<=n;i++)if(s[i]^s[n-i])flag=0;

	if(!flag)puts("-1"),exit(0);

	int p=1,pre=0;

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

		if(s[i]){

			if(pre)add(pre,i);

			for(int j=pre+1;j<i;j++)add(i,j);

			pre=i;

		}

	}

	for(int i=pre+1;i<=n;i++)add(pre,i);

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxn = 1e5 + 7;

char s[maxn];

int main(){

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

    int len = strlen(s+1);

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

        printf("-1\n");

        return 0;

    }

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

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

            printf("-1\n");

            return 0;

        }

    }

    int record = -1;

    for(int i = len/2; i >= 1; --i){

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

            record = i;

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

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

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

            }

            break;

        }

    }

    for(int i = record-1; i >= 1; --i){

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

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

            record = i;

        }

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int maxn=2e5+5;

const int mod=1e9+7;

//const int mod=998244353;

#define rep(i,a,n) for(int i=a;i<n;i++)

#define per(i,a,n) for(int i=n-1;i>=a;i--)

#define pb push_back

#define fi first

#define se second

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

#define SZ(x) ((int)(x).size())

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

ll qpow(ll a,ll b){ll ans=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)ans=ans*a%mod;a=a*a%mod;}return ans;}

ll gcd(ll a,ll b){return b>0?gcd(b,a%b):a;}



int a[maxn];

char s[maxn];

int main(){

    int n,m,T;

    cin>>s+1;

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

	n=(int)strlen(s+1);

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

		printf("-1\n");

		return 0;

	}

	int now = 2;

	while(now<=n-now){

		if(s[now]!=s[n-now]) {

			printf("-1\n");

			return 0;

		}

		now++;

	}

	int root=2,num=1;

	now=2;

	printf("2 1\n");

	while(now<=n-now){

		if(s[now]=='1'){

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

			root=now;

		}else{

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

		}

		num++;

	}

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

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

	}



    return 0;

}




// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

using namespace std;

const int maxn = 1e5 + 7;

char s[maxn];

int main(){

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

    int len = strlen(s+1);

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

        printf("-1\n");

        return 0;

    }

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

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

            printf("-1\n");

            return 0;

        }

    }

    int record = -1;

    for(int i = len/2; i >= 1; --i){

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

            record = i;

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

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

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

            }

            break;

        }

    }

    for(int i = record-1; i >= 1; --i){

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

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

            record = i;

        }

    }

}


// Fastest known solution for this problem: