Problem1466--Pythagorean theorem

1466: Pythagorean theorem

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 11  Solved: 4
[Submit] [Status] [Web Board] [Creator:]

Description

The following figure is a figure and formula that represents the Pythagorean theorem.
Write a program that outputs the integers a, b, and c for all triangles that satisfy the Pythagorean theorem  less than or equal the hypotenuse length, given the maximum length of the hypotenuse.


Input

The maximum value (m) of the hypotenuse forming a right triangle is given as an integer (10 <= m <=500).

Output

The lengths of the three sides a, b, c (integers) of the triangle satisfying the Pythagorean theorem less than or equal to the hypotenuse of the maximum length are printed, one per line, as in the output example (note that a <= b<= c and the output order is in ascending order of a value, or in ascending order of b value when a values are the same, or in ascending order of c value when b values are the same).
Also, a combination of three pairs of the same values should be output only once. That is, if 3, 4, 5 is output, other combinations in that order, such as 4, 3, 5 or 5, 4, 3 should not be output.

Sample Input Copy

10

Sample Output Copy

3, 4, 5
6, 8, 10

Source/Category