#pragma optimize(3)
#include <bits/stdc++.h>
#define MAXN 10010
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int x, y, ans[MAXN], tmp = 0;
cin >> x >> y;
int count = 0;
for (int i = x; i <= y; i++) {
if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {
i = ans[tmp];
count++;
tmp++;
}
}
cout << count << "\n";
for (int i = 0; i <= tmp; i++) {
cout << ans[i] << " ";
}
return 0;
}