#include using namespace std; typedef long long ll; int main() { int a, b; cin>>a>>b; for (int i = a; i <= b; i++) { if (i % 3 == 0) { cout << i << endl; continue; } int j = i; while (j) { if (j % 10 == 3) { cout << i << endl; break; } j /= 10; } } return 0; }