#include using namespace std; #define ll long long #define endl "\n" int main() { int a, b; cin >> a >> b; for (int i = a; i <= b; ++i) { bool flag = false; if (i % 3 == 0) { flag = true; } int t = i; while (t) { if (t % 10 == 3) { flag = true; break; } t /= 10; } if (flag) { cout << i << endl; } } return 0; }