Simple Equations - Extreme!!

This is an extreme version of a boring mathematics problem. Let us recall the scenario: we have three different integers, x, y and z, which satisfy the following three relations: • x+y+z=A • xyz = B • x2 + y2 + z2 = C You are asked to write a program that solves for x, y and z for given values of A, B and C. Input The first line of the input file gives the number of test cases N (N < 250) lines gives the values of A, B and C (1 ≤ A, B, C ≤ 6 × 1018 = 6000000000000000000). Output For each test case, output the corresponding values of x, y and z. If there are many possible answers, choose the one with the least value of x. If there is a tie, output the one with the least value of y. If there is no solution, output the line ‘No solution.’ instead. Sample Input 2 123 6 6 14 Sample Output No solution. 123