#include<bits/stdc++.h>
using namespace std;
int main()
{ int n,j;
  cin>>n;
  for(j=1;j<=n;j++)
   { if(j%6==0||j%10==0||j%14==0||j%15==0||j%21==0||j%35==0)
      cout<<j<<endl;
   }
	return 0;
}


/**************************************************************
	Problem: 1746
	User: cx001
	Language: C++
	Result: Accepted
	Time:11 ms
	Memory:2072 kb
****************************************************************/