#include using namespace std; int main(int argc, const char* argv[]) { int A, B; cin >> A >> B; for (int i = 0; i <= B - A; i++) { int t = A + i; if (t % 3 == 0 || to_string(t).find("3") != -1) cout << t << endl; } return 0; }