#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long int ll; //#include using namespace std; int main() { int Q; Q = 1; //cin >> Q; while (Q--) { ll x, y; cin >> x >> y; for (ll i = x; i <= y; i++) { bool f = 0; if (i % 3 == 0)f = 1; ll t = i; while (t) { if (t % 10 == 3)f = 1; t /= 10; } if (f)cout << i << endl; } } return 0; }