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