#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; ll a, b; cin >> a >> b; ll ans = 0; for (ll n = a; n <= b; ++n) { if (n%3==0) cout << n << endl; else { string sn = to_string(n); for (auto c : sn) { if (c=='3') {cout << n << endl; break;} } } } return 0; }