#include using namespace std; int main() { long long a, b; cin >> a >> b; while(1){ if(a > b) break; bool ok = false; if(a % 3 == 0) ok = true; long long k = a; while(k > 0){ if(k % 10 == 3) ok = true; k /= 10; } if(ok) cout << a << endl; a++; } }