s=eval(input())

n=len(s)

if s[0]=="0" or s[-1]=="1":print((-1));exit()

for i in range(n-1):

  if s[i]!=s[-i-2]:print((-1));exit()

b=[]

for i in range(n-1):

  if s[i]=="1":

    for j in b:print((j+1,i+1))

    b=[]

  b.append(i)

for j in b:print((j+1,n))
s=input()

if s[0]=="0":exit(print(-1))

if s[-1]=="1":exit(print(-1))

for i in range(len(s)-1):

  if s[i]!=s[(len(s)-1)-(i+1)]:exit(print(-1))

ans=[]

for i in range(len(s)-1):

  if s[i]=="1":

    for j in ans:print(j+1,i+1)

    ans=[]

  ans.append(i)

for j in ans:print(j+1,len(s))

s = eval(input())
n = len(s)
if s[0] == "0" or s[-1] == "1":
    print((-1))
    exit()
for i in range(n - 1):
    if s[i] != s[-i - 2]:
        print((-1))
        exit()
b = []
for i in range(n - 1):
    if s[i] == "1":
        for j in b:
            print((j + 1, i + 1))
        b = []
    b.append(i)
for j in b:
    print((j + 1, n))

s = input()
if s[0] == "0":
    exit(print(-1))
if s[-1] == "1":
    exit(print(-1))
for i in range(len(s) - 1):
    if s[i] != s[(len(s) - 1) - (i + 1)]:
        exit(print(-1))
ans = []
for i in range(len(s) - 1):
    if s[i] == "1":
        for j in ans:
            print(j + 1, i + 1)
        ans = []
    ans.append(i)
for j in ans:
    print(j + 1, len(s))

-s = eval(input()) -n = len(s) -if s[0] == "0" or s[-1] == "1": -    print((-1)) -    exit() -for i in range(n - 1): -    if s[i] != s[-i - 2]: -        print((-1)) -        exit() -b = [] -for i in range(n - 1): +s = input() +if s[0] == "0": +    exit(print(-1)) +if s[-1] == "1": +    exit(print(-1)) +for i in range(len(s) - 1): +    if s[i] != s[(len(s) - 1) - (i + 1)]: +        exit(print(-1)) +ans = [] +for i in range(len(s) - 1): -        for j in b: -            print((j + 1, i + 1)) -        b = [] -    b.append(i) -for j in b: -    print((j + 1, n)) +        for j in ans: +            print(j + 1, i + 1) +        ans = [] +    ans.append(i) +for j in ans: +    print(j + 1, len(s))