#include using namespace std; int main(){ int x,y,z; cin >> x >> y; for(int i = x; i<=y; i++){ z = 0; if(i%3==0||i%10==3) z = 1; for(int t = i;t;t/=10) if(t%10==3) z = 1; if(z==1) cout << i << endl; } return 0; }