#include #include #include #include #include #include #include #include #define REP(i,k,n) for(int i=k;i P; int main() { ll a,b; cin >> a >> b; REP(i,a,b+1) { stringstream ss; ss << i; string s = ss.str(); if(find(s.begin(),s.end(),'3') != s.end() || i%3 == 0) { cout << i << endl; } } return 0; }