Scanf.scanf "%d" (fun x ->
    let module S = Set.Make (struct type t = int let compare = compare end) in
    let rec loop i c set =
        if i = 32 then set else
        if c > x then loop (i + 1) ((i + 1) * (i + 1)) set else
            loop i (c * i) (S.add c set)
    in
    loop 2 4 (S.singleton 1) |> S.max_elt |> Printf.printf "%d\n"
)