#include #include #include #include using namespace std; bool isNabeatsuNumber(long num){ if (num % 3 == 0){ return true; } int remainder = 0; while (num > 10){ remainder = num % 10; if (remainder % 10 == 3) { return true; } num /= 10; } if (num % 10 == 3){ return true; } return false; } int main(){ long min, max; cin >> min >> max; for (long num = min; num <= max; num++){ if (isNabeatsuNumber(num)){ cout << num << endl; } } return 0; }