from bisect import bisect_right

s = list(map(int,list(eval(input()))))

s.insert(0,-1)

n = len(s)-1

flag = 0

if s[n]==1 or s[1]==0 or s[n-1]==0:

    flag = 1

else:

    for i in range(2,n-1):

        if s[i]!=s[n-i]:

            flag = 1

            break

if flag==1:

    print((-1))

else:

    print((n,n-1))

    A = [1,n-1]

    cur = 1

    for i in range(2,n-1):

        if s[i]==1:

            print((cur,i))

            cur = i

            A.append(i)

    print((cur,n-1))

    A = sorted(A)

    for i in range(2,n-1):

        if s[i]==0:

            ind = bisect_right(A,i)

            print((i,A[ind]))
s = input().strip()

n = len(s)

s = "0"+s

flag = 0

if s[n]=="1" or s[1]=="0":

    flag = 1

else:

    for i in range(1,n):

        if s[i]!=s[n-i]:

            flag = 1

            break

if flag==1:

    print((-1))

else:

    A = [1]

    for i in range(2,n):

        if s[i]=="1":

            while A:

                print((A.pop(),i))

            A = [i]

        else:

            A.append(i)

    print((n-1,n))

            
from bisect import bisect_right

s = list(map(int, list(eval(input()))))
s.insert(0, -1)
n = len(s) - 1
flag = 0
if s[n] == 1 or s[1] == 0 or s[n - 1] == 0:
    flag = 1
else:
    for i in range(2, n - 1):
        if s[i] != s[n - i]:
            flag = 1
            break
if flag == 1:
    print((-1))
else:
    print((n, n - 1))
    A = [1, n - 1]
    cur = 1
    for i in range(2, n - 1):
        if s[i] == 1:
            print((cur, i))
            cur = i
            A.append(i)
    print((cur, n - 1))
    A = sorted(A)
    for i in range(2, n - 1):
        if s[i] == 0:
            ind = bisect_right(A, i)
            print((i, A[ind]))

s = input().strip()
n = len(s)
s = "0" + s
flag = 0
if s[n] == "1" or s[1] == "0":
    flag = 1
else:
    for i in range(1, n):
        if s[i] != s[n - i]:
            flag = 1
            break
if flag == 1:
    print((-1))
else:
    A = [1]
    for i in range(2, n):
        if s[i] == "1":
            while A:
                print((A.pop(), i))
            A = [i]
        else:
            A.append(i)
    print((n - 1, n))

-from bisect import bisect_right - -s = list(map(int, list(eval(input())))) -s.insert(0, -1) -n = len(s) - 1 +s = input().strip() +n = len(s) +s = "0" + s -if s[n] == 1 or s[1] == 0 or s[n - 1] == 0: +if s[n] == "1" or s[1] == "0": -    for i in range(2, n - 1): +    for i in range(1, n): -    print((n, n - 1)) -    A = [1, n - 1] -    cur = 1 -    for i in range(2, n - 1): -        if s[i] == 1: -            print((cur, i)) -            cur = i +    A = [1] +    for i in range(2, n): +        if s[i] == "1": +            while A: +                print((A.pop(), i)) +            A = [i] +        else: -    print((cur, n - 1)) -    A = sorted(A) -    for i in range(2, n - 1): -        if s[i] == 0: -            ind = bisect_right(A, i) -            print((i, A[ind])) +    print((n - 1, n))