Scanf.scanf "%d %d" (fun a b -> Printf.printf "%d\n" @@ if b = 0 then 1 else if a = -1 then 2 else -1 )