#include #include using namespace std; int main() { int A, B; char tmp[30]; cin >> A >> B; for( int i = A; i <= B; i++ ) { if( i % 3 == 0 ) { cout << i << endl; continue; } sprintf( tmp, "%d", i ); if( strchr( tmp, '3' ) != NULL ) { cout << i << endl; } } return 0; }