#include<bits/stdc++.h>
using namespace std;
bool isleap(int &year) {
if ((year % 4 == 0 && year % 100 != 0) || year % 400)
return true;
return false;
}
int main() {
vector<int> v;
bool FLAG = false;
int x, y, count = 0;
cin >> x >> y;
while (x != y) {
if(isleap(x)) {
++count;
v.push_back(x);
}
x+=4;
}
cout << count <<endl;
for (auto i :v) {
if (FLAG)
cout << " ";
cout << i;
FLAG= true;
}
}