print(*filter(lambda x:x%100 if x%400!=0 else x,range(2000,int(input())+1,4)),sep='\n')