#include <bits/stdc++.h>
using namespace std;
int main(){
for(int i=1000;i<=9999;i++){
if(i%2==0&&i%3==0&&i%7==0)cout<<i<<"\n";
}
return 0;
}
/**************************************************************
Problem: 1090
User: zhouhongyi
Language: C++
Result: Wrong Answer
****************************************************************/