#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int a,b; cin >> a >> b; for (int i=a; i<=b;++i) { string s=to_string(i); if (s.find("3")!=string::npos) { cout << i << "\n"; } else if ((i%3)==0) cout << i << "\n"; } return 0; }