#include using namespace std; using ll = long long; using P = pair; #define rep2(i,a,n) for(int i = (a);i < (n);i++) #define rep(i,n) rep2(i,0,n) #define INF (1LL << 60) int main(void){ ll a,b; cin >> a >> b; for(ll i = a;i <= b;i++){ if(i % 3 == 0){ cout << i << endl; } else { bool check = false; string s = to_string(i); rep(j,s.size()){ if(s[j] == '3')check = true; } if(check)cout << i << endl; } } }