#include using namespace std; int main(){ int a,b; cin >> a >> b; for(int i = a;i <= b;i++){ int hoge = i; while(hoge % 10 != 3 && hoge)hoge /= 10; if(!hoge || i % 3)continue; cout << i << endl; } return 0; }