import math,complex,strutils,sequtils,algorithm proc `^`[T](x : T,i : int):T = if i == 1: return x elif i == 0: return 1 elif i mod 2 == 0: return (x * x) ^ (i div 2) else: return ((x * x) ^ (i div 2)) * x type Complex = tuple[re,im : float64] proc solve3equation(a,b,c,d : float64):tuple[s,t,u : Complex]= var D = (-27 * a ^ 2 * d + 9 * a * b * c - 2 * b ^ 3) ^ 2 + 4 * (3 * a * c - b ^ 2) ^ 3 var F,g,h : Complex var sq3 : float64 sq3 = pow(2.0.float64, 1.float64 / 3.float64) if D < 0: F = ( - 27 * a ^ 2 * d + 9 * a * b * c - 2 * b ^ 3, sqrt(abs(D))) else: F = ( - 27 * a ^ 2 * d + 9 * a * b * c - 2 * b ^ 3 + sqrt(D),0.0) F = pow(F, (1 / 3, 0.0).Complex) result.s = F / (3 * pow(2.0, 1 / 3) * a) - sq3 * (3 * a * c - b * b) / (3 * a * F) - b / (3 * a) g = (1.0,sqrt(3.0)) h = (1.0,-sqrt(3.0)) result.t = - F * h / (6 * sq3 * a) + g * (3 * a * c - b * b) / (3 * sq3 ^ 2 * a * F) - b / (3 * a) result.u = - F * g / (6 * sq3 * a) + h * (3 * a * c - b * b) / (3 * sq3 ^ 2 * a * F) - b / (3 * a) var a,b,c : int64 x1,x2,x3 : Complex s,t,u : int64 (a,b,c) = stdin.readline.split.map(parseBiggestInt) (x1,x2,x3) = solve3equation(1.0,a.float64,b.float64,c.float64) (s,t,u) = (x1.re.int64,x2.re.int64,x3.re.int64) var ans = newSeq[int](3) block hosei: for i in -4..4: for j in -4..4: for k in -4..4: var s2 = s + i t2 = t + j u2 = u + k if (s2 * t2 * u2 == - c and s2 * t2 + t2 * u2 + u2 * s2 == b and s2 + t2 + u2 == - a): (ans[0],ans[1],ans[2]) = (s2.int,t2.int,u2.int) break hosei ans.sort(system.cmp) echo ans.join(" ")