# Programmer: Sriram Pemmaraju
# Date: Feb 20, 2014
import math

M = int(input("Enter a positive integer for M: "))

# nested loops to generate possible values for x and y (at most M)
# x and y are generated independently, but y > x always
x = 3
while x <= M:
    y = x + 1
    while y <= M:
        sumOfSquares = x*x + y*y
        
        # is sumOfSquares is perfect square, then we can 
        # find z
        candidateZ = round(math.sqrt(sumOfSquares))
        if candidateZ*candidateZ == sumOfSquares:
            print(x, y, candidateZ)
            
        y = y + 1
    x = x + 1
        
