import math
def find_primitive_pythagorean_triples(N, M):
triples = []
max_m = int(math.isqrt(M)) + 1
for m in range(2, max_m):
for n in range(1, m):
if (m - n) % 2 == 1 and math.gcd(m, n) == 1:
a = m**2 - n**2
b = 2 * m * n
c = m**2 + n**2
if a > b:
a, b = b, a
if N <= a <= M and N <= b <= M and N <= c <= M:
triples.append((a, b, c))
# Remove duplicates and sort
unique_triples = sorted(list(set(triples)))
return unique_triples
def main():
N, M = map(int, input().split())
triples = find_primitive_pythagorean_triples(N, M)
if not triples:
print("NA")
else:
for a, b, c in sorted(triples):
print(f"{a} {b} {c}")
if __name__ == "__main__":
main()