#include <bits/stdc++.h>
using namespace std;
int main(){
int a=1,b;
cin>>b;
while(a<=b){
if(a%2==0&&a%3!=0){
cout<<a<<endl;
}
a++;
}
}
/**************************************************************
Problem: 1699
User: sucongyi
Language: C++
Result: Accepted
Time:15 ms
Memory:2072 kb
****************************************************************/