#include using namespace std; int main(){ long long a, b, i, t; cin >> a >> b; for( i = a ; i <= b ; i = i + 1 ){ t = i; if( t % 3 == 0 ) cout << i << endl; else while( t > 0 ){ if( t % 10 == 3 ){ cout << i << endl; break; } t = t / 10; } } return 0; }