#include using namespace std; int main(void){ // Here your code ! ios::sync_with_stdio(false); int A, B; cin >> A >> B; for(int i=A;i<=B;i++){ int j = i; bool three = false; if(i%3==0){ cout << i << endl; continue; } while(j>0){ if((j%10)==3){ three = true; break; } j/=10; } if(three){ cout << i << endl; } } return 0; }