import math


def find(n):
    # max of x can be sqrt of n
    n1 = int(math.ceil(math.sqrt(n)))
    lst = set()
    for i in range(1, n1):
        for j in range(i + 1, n1):

            if i**2 + j**2 >= n:
                break

            tz = int(math.sqrt(n - i**2 - j**2))
            if tz ** 2 == n - i**2 - j**2:
                
                #This if-block makes the elements in tuple, sorted.
                #so that set can compare two values for equality
                #because (1, 2, 3) != (2, 3, 1)
                if tz < i:
                    i, j, tz = tz, i, j
                elif tz < j:
                    j, tz = tz, j
                
                a = (i, j, tz)
                lst.add(a)
    return lst

print find(2134)
