#include<iostream>

using namespace std;

int main()

{   

    int n=0; 

for(int year=2000;year<=3000;year++)

{

if((year%4==0&&year%100!=0)||(year%400==0))

{

cout<<year<<"    ";

n++;

    } 

if(n%10==0)

cout<<"";

    }   

    return 0;

}