#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ long long a,b; cin >> a >> b; for(; a<=b; a++){ bool ok = false; ok = ok | (a%3 == 0) ; for(long long c=a; c>0; c /= 10){ ok = ok | ((c%10) == 3); } if(ok) cout << a << endl; } return 0; }