#include #include #include using namespace std; int main() { int A, B; cin >> A >> B; for(int i = A; i <= B; i++) { string str = to_string(i); if(i % 3 == 0) cout << i << endl; else if(str.find("3") != -1) { cout << i << endl; } } return 0; }