#include<bits/stdc++.h>
using namespace std;
int main(){
	int n=100,a=200;
	while(a>=n){
		if(n%3==2 && n%5==3 && n%7==5)
			cout<<n;
		n+=1;	
	}
	
	return 0;
}
/**************************************************************
	Problem: 1017
	User: cyp
	Language: C++
	Result: Accepted
	Time:4 ms
	Memory:2072 kb
****************************************************************/