a=int(raw_input()) for i in range(3,a+1): b=360/i c=b*(i-1) if b==c: print(i)