using namespace std; #include #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define __ return EXIT_SUCCESS; #define FOR(I,A,B) for(int I=A;I'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);} void writer(int x, char c){int s=0,m=0;char f[10];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)MYPC('-');while(s--)MYPC(f[s]+'0');MYPC(c);} int main() { _ int a,b; reader(&a);reader(&b); FOR(i,a,b) { if(!(i%3))writer(i,'\n'); else if(to_string(i).find('3',0)!=string::npos)writer(i,'\n'); } __ }