Scanf.scanf "%s" (fun s ->
    let n = String.length s in
    let sentinel = min_int in
    if s.[n - 1] = '1' || s.[0] = '0' || s.[n - 2] = '0' then print_endline "-1" else
        let rec loop i sw =
            if i * 2 > n - 2 then sw else
                if s.[i] <> s.[n - 2 - i] then sentinel else
                if i = sw then (
                    if s.[i] = '1' then loop (i + 1) (sw + 1)
                                   else loop (i + 1) sw
                ) else (
                    if s.[i] = '0' then loop (i + 1) sw
                                   else sentinel
                )
        in
        let ans = loop 0 0 in
        if ans = sentinel then print_endline "-1" else (
            for i = 1 to ans do
                Printf.printf "%d %d\n" i (i + 1)
            done;
            for i = ans + 2 to n do
                Printf.printf "1 %d\n" i
            done
        )
)