#include "bits/stdc++.h" using namespace std; int main() { int A, B; cin >> A >> B; for (int i = A; i <= B; i++) { bool check = false; if (i % 3 == 0) check = true; int x = i; while (x != 0) { if (x % 10 == 3) check = true; x /= 10; } if (check) cout << i << endl; } }