#include <iostream>
size_t suma(size_t n) {
size_t s = 0;
for (size_t i = 2; i <= (n >> 1); ++i)
if (!(n % i))
s += i;
return s;
}
void subperfect(size_t a, size_t b) {
bool test = false;
while (a <= b) {
if (b < suma(b)) {
std::cout << b << ' ';
test = true;
}
--b;
}
if (!test)
std::cout << "nu exista";
}
int main() {
size_t a, b;
std::cin >> a >> b;
subperfect(a, b);
}