import calendar for i in range(2000,int(input())+1): if(calendar.isleap(i)): print(i)