Scanf.scanf "%d" (fun n ->
    let rec check a b =
        if b = 0 then 0, 0 else
            let ue = 4 * a * b - n * (a + b) in
            let shita = n * a * b in
            if ue <= 0 then 0, 0 else
                if shita mod ue <> 0 then check a (b - 1) else
                    b, shita / ue
    in

    let rec loop a =
        let b, c = check a a in
        if b <> 0 then Printf.printf "%d %d %d\n" a b c else loop (a - 1)
    in
    loop 3500
)