#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int64_t A, B; cin >> A >> B; auto f = [](int64_t x) { while (x > 0) { if (x % 10 == 3) return true; x /= 10; } return false; }; for (int64_t i = A; i < B + 1; i++) { if (i % 3 == 0 || f(i)) cout << i << '\n'; } return 0; }