#include using namespace std; int main() { int ans = 0; int a, b; cin >> a >> b; int c = a / 10; for (int i = a; i <= b; i++) { if(a % 10 == 0) c = a / 10; int d = a - c * 10; if (!(a % 3 || c % 3 || d % 3)) cout << a << endl; } }