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