#include bool judge(int x) { if (x % 3 == 0) return true; while (x > 0) { if (x % 10 == 3) return true; x /= 10; } return false; } void solve() { int a, b; std::cin >> a >> b; for (int x = a; x <= b; ++x) { if (judge(x)) std::cout << x << std::endl; } } int main() { std::cin.tie(nullptr); std::cout.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }