#include #include #include #include using namespace std; template int maxReturn(T a, T b) {if (a > b) {return a;} else {return b;}} template int minReturn(T a, T b) {if (a < b) {return a;} else {return b;}} int main(void){ int A,B; string ans = ""; cin >> A >> B; for (int i = A; i <= B; i++) { if (i % 3 == 0) { ans += to_string(i) + "\n"; } else { string tmp = to_string(i); size_t count = tmp.length(); for (int j = 0; j < count; j++) { if (tmp[j] == '3') { ans += tmp + "\n"; break; } } } } cout << ans << endl; }