Scanf.scanf "%s" (fun s ->
    let n = String.length s in
    let proc () =
        let rec loop i prev acc =
            if i = n - 1 then prev, acc else 
                let acc = (prev, i + 2) :: acc in
                if i >= n / 2 then loop (i + 1) prev acc else
                    if s.[i] <> s.[n - 2 - i] then prev, [] else
                    if s.[i] = '1' then loop (i + 1) (i + 2) acc
                                   else loop (i + 1) prev    acc
        in
        let prev, acc = loop 0 1 [] in
        if acc = [] then print_endline "-1" else
            List.iter (fun (a, b) -> Printf.printf "%d %d\n" a b) acc
    in
    if s.[n - 1] = '1' || s.[0] = '0' || s.[n - 2] = '0' then print_endline "-1" else proc ()
)