#include //cin, cout #include //vector #include //sort,min,max #include //string #include //fixed #include //setprecision #include //swap #include //abs(int) #include //sqrt #include //stringstream,getline #include //ceil using namespace std; int main() { long long int A, B; cin >> A >> B; long long int temp = 0; for (long long int i = A; i <= B; i++) { temp = i; if (temp % 3 == 0) { cout << i << endl; continue; } while (temp >= 1) { if (temp % 10 == 3) { cout << i << endl; break; } temp = temp / 10; } } return 0; }