#include #define rep(i, n) for(int i = 0; i < (n); i++) using namespace std; using P = pair; using ll = long long; int main(){ ll a, b; cin >> a >> b; for(int i = a; i <= b; i++){ int t = i; bool ok = false; while(t > 0){ if(t%10 == 3) ok = true; t /= 10; } if(i%3 == 0 || ok) cout << i << endl; } }