#include using namespace std; bool isThree(int n){ while(1){ if(n % 10 == 3){ return true; }else if(n < 13){ return false; } n /= 10; } } int main(){ int A, B; cin >> A >> B; while(A <= B){ if(A % 3 == 0 || isThree(A)){ cout << A << endl; } A++; } return 0; }