x = [c  for c in eval(input())]



n = len(x)

ret=[]

for i in range(n-1):

    ret.append([0,0])



if x[n-1] == "1":

    print((-1))

elif x[0] == "0":

    print((-1))

else:

    flg = 1

    for i in range(n-1):

        if x[i] != x[n-1-i-1]:

            flg = 0

    if flg == 0:

        print((-1))

    else:

        a=1

        for i in range(n-1):

            if x[i] == "1":

                ret[i] = [a,i+2]

                a=i+2

            else:

                ret[i] = [a,i+2]

        

        for i in range(n-1):

            print(("{0} {1}".format(ret[i][0], ret[i][1])))
x = eval(input())

n = len(x)

ret=[]

if x[n-1]=="1" or x[0]=="0" or x[:-1]!=x[-2::-1]:

    print((-1))

else:

    a=1

    for i in range(n-1):

        print(("{0} {1}".format(a, i+2)))

        if x[i] == "1":

            a=i+2
x = [c for c in eval(input())]
n = len(x)
ret = []
for i in range(n - 1):
    ret.append([0, 0])
if x[n - 1] == "1":
    print((-1))
elif x[0] == "0":
    print((-1))
else:
    flg = 1
    for i in range(n - 1):
        if x[i] != x[n - 1 - i - 1]:
            flg = 0
    if flg == 0:
        print((-1))
    else:
        a = 1
        for i in range(n - 1):
            if x[i] == "1":
                ret[i] = [a, i + 2]
                a = i + 2
            else:
                ret[i] = [a, i + 2]
        for i in range(n - 1):
            print(("{0} {1}".format(ret[i][0], ret[i][1])))

x = eval(input())
n = len(x)
ret = []
if x[n - 1] == "1" or x[0] == "0" or x[:-1] != x[-2::-1]:
    print((-1))
else:
    a = 1
    for i in range(n - 1):
        print(("{0} {1}".format(a, i + 2)))
        if x[i] == "1":
            a = i + 2

-x = [c for c in eval(input())] +x = eval(input()) -for i in range(n - 1): -    ret.append([0, 0]) -if x[n - 1] == "1": -    print((-1)) -elif x[0] == "0": +if x[n - 1] == "1" or x[0] == "0" or x[:-1] != x[-2::-1]: -    flg = 1 +    a = 1 -        if x[i] != x[n - 1 - i - 1]: -            flg = 0 -    if flg == 0: -        print((-1)) -    else: -        a = 1 -        for i in range(n - 1): -            if x[i] == "1": -                ret[i] = [a, i + 2] -                a = i + 2 -            else: -                ret[i] = [a, i + 2] -        for i in range(n - 1): -            print(("{0} {1}".format(ret[i][0], ret[i][1]))) +        print(("{0} {1}".format(a, i + 2))) +        if x[i] == "1": +            a = i + 2