#include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int a, b; cin >> a >> b; for(int i=a;i<=b;i++) { string i_str = to_string(i); int digitSum = 0; bool out = false; for(int j=0;j<(int)i_str.size();j++) { if(i_str[j] == '3') { out = true; break; } digitSum += i_str[j] - '0'; } if(digitSum % 3 == 0) out = true; if(out) cout << i << '\n'; } return 0; }