n = int(input()) stock = [] def find(l): global stock stock = [] for i in range(l+1): for j in range(i+1): for k in range(j+1): if i+j+k ==l: stock.append([i+1,j+1,k+1]) def cal(): for i in stock: if i[0]*i[1]*i[2] == n: return True return False l = 1 sigh = False while not sigh: find(l) sigh = cal() l = l + 1 print(l) m = l-1 print(m, n-1)