# include # include # include # include # include # include # include # include # include # include # include # include # include using namespace std; using LL = long long; constexpr int MOD = 1000000000 + 7; //足し算してオーバーフローで死なないように確認しようね constexpr int INF = 1000000000; const double PI = acos(-1); int main() { LL a, b; cin >> a >> b; for (int i = a; i <= b; i++) { if (i % 3 == 0) { cout << i << endl; } else { int num = i; while (num > 1) { if (num % 10 == 3) { cout << i << endl; break; } num /= 10; } } } }