#include using namespace std; bool Is3(int x){ if(x==0)return false; if(x%10==3)return true; else return Is3(x/10); } int main(){ int A,B; cin >> A >> B; for(int n=A;n<=B;n++){ if(n%3==0 || Is3(n))cout << n << endl; } return 0; }