#include "iostream" using namespace std; int main(){ int a,b; cin >> a >> b; for (int x = a; x <= b; x++){ int tmp = x; if (x % 3 == 0) cout << x << endl; else { do{ if (tmp % 10 == 3){ cout << x << endl; break; } tmp /= 10; } while (tmp); } } return 0; }