#include using namespace std; int main(){ int a, b; cin >> a >> b; int i, x(0), y(0); int xcheck(0), ycheck(0); for(i=a;i<=b;i++){ //MULTIPLE OF THREE xcheck = 0; if(i%3 == 0) xcheck = 1; //HAVE THREE int tmp = i; ycheck = 0; do{ if(tmp%10 == 3) ycheck = 1; tmp /= 10; }while(tmp > 0); if(xcheck || ycheck) cout << i << endl; } return 0; }