You are given an integer N.  Find a triple of positive integers h, n and w such that 4/N = 1/h + 1/n + 1/w.  If there are multiple solutions, any of them will be accepted.
def main():
    N = int(input())

    for h in range(1, 3501):
        for n in range(h+N-1, 3501):
            if (4*h*n - N*h - N*n)>0 and N*h*n % (4*h*n - N*h - N*n):
                w = N*h*n // (4*h*n - N*h - N*n)
                print(h, n, w)
                exit()

if __name__ == "__main__":
    main()
def main():
    N = int(input())

    for h in range(1, 3501):
        for n in range(max(h, N-h+1), 3501):
            if (4*h*n - N*h - N*n)>0 and N*h*n % (4*h*n - N*h - N*n)==0:
                w = N*h*n // (4*h*n - N*h - N*n)
                print(h, n, w)
                exit()

if __name__ == "__main__":
    main()