#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++) { string tmp = to_string(i); if (i % 3 == 0) { ans += tmp + "\n"; } else { size_t count = tmp.length(); for (int j = 0; j < count; j++) { if (tmp[j] == '3') { ans += tmp + "\n"; break; } } } } cout << ans << endl; }