#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); long long a, b; cin >> a >> b; for(long long i = a; i <= b; i++) { if(i % 3 == 0) { cout << i << endl; } else { long long x = i; while(x > 0) { if(x % 10 == 3) { cout << i << endl; break; } x /= 10; } } } return 0; }