let rec div n m = if n = 1 then (1, m) else if m mod n = 0 then (n, m/n) else div (n-1) m let () = let c = Scanf.scanf "%d\n" (fun x -> x) in let n, m = div (c-1) c in Printf.printf "%d %d\n" n m