#include using namespace std; int main(){ int A, B, nowNumber, countThree, i; cin >> A >> B; for(nowNumber=A;nowNumber<=B;nowNumber++){ countThree = 0; if(nowNumber % 3 == 0){ countThree = 1; } for(i=nowNumber;i;i/=10){ if(i % 10 == 3){ countThree = 1; } } if(countThree == 1){ cout << nowNumber << endl; } } }