#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i,n) for(int i=0;i( \ ( std::ostringstream() << std::dec << x ) ).str() #define ALL(s) (s).begin(), (s).end() using namespace std; typedef long long unsigned int llu; typedef long long ll; const string D_blue = "\x1b[36m"; const string D_green = "\x1b[32m"; const string D_red = "\x1b[31m"; const string D_yellow = "\x1b[33m"; const string Db_red = "\x1b[41m"; const string Db_yellow = "\x1b[43m"; const string D_end = "\x1b[39m"; const string Db_end = "\x1b[49m"; int main (){ long a,b; while (cin >> a >> b){ for(long l = a ; l < b+1;l++){ if(l % 3 == 0)cout << l << endl; else{ char c[10]; sprintf(c,"%ld",l); if(find(c,c+10,'3') != c+10) cout << l << endl; } } } return 0; }