# pyttrip3
# Sections 7-9, Q.3. p.34, p.254
# input: 100 or 200

import math

max = int(input("max=? "))
c = 1
while c < max:
  c += 4
  for a in range(1,c):
    b1 = math.sqrt(c*c - a*a)
    b = math.trunc(b1)
    if a < b:
      if math.modf(b1)[0] == 0:
        if math.gcd(a,b) == 1:
          print(f"{a:5} {b:5} {c:5}")
