def wqs(a): for i in range(2,a+1): lst1=list() for j in range(1,i): if i%j==0: lst1.append(j) if sum(lst1)==i: print(i) a=int(input()) wqs(a)