#include using namespace std; int main() { int A, B; cin >> A >> B; while (A != B) { if (A % 3 == 0) { cout << A << endl; } else { int a = A; while (a != 0) { if (a % 10 == 3) { cout << A << endl; break; } a = a / 10; } } A++; } return 0; }