open System type Sol() = member this.minAlpha (a:int64, b:int64, c:int64) = let sq = Seq.initInfinite (fun i -> if i%2 = 0 then int64(i/2) else int64(-i/2)) sq |> Seq.find (fun j -> j*j*j + a*j*j + b*j + c = 0L) member this.Solve() = let (A, B, C) = stdin.ReadLine().Split(' ') |> fun ss -> (int64 ss.[0], int64 ss.[1], int64 ss.[2]) let alpha = this.minAlpha (A,B,C) let A2 = A + alpha let B2 = B + alpha*A2 let D = A2*A2 - 4L*B2 let sqrtD:int64 = (double D) |> sqrt |> int64 let ans = alpha :: (-A2 + sqrtD)/2L :: (-A2 - sqrtD)/2L :: [] |> List.sort |> Seq.toArray printfn "%d %d %d" ans.[0] ans.[1] ans.[2] let mySol = new Sol() mySol.Solve()