#include #include #include using namespace std; int main() { int A, B; cin >> A >> B; for (int i = A; i <= B; i++) { if (i % 3 == 0) { cout << i << endl; continue; } for (int t = i; t > 0; t /= 10) { if (t % 10 == 3) { cout << i << endl; break; } } } return 0; }