#include <iostream>
#include <fstream>
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
int main()
{
int a, b, num, i, prima, ultima;
f >> a >> b;
int gasit=0;
for (i=a; i<=b; ++i)
{
ultima=i%10;
num=i;
while (num>9) num/=10;
prima=num;
if (prima==ultima)
{
g << i << " ";
gasit=1;
}
}
if (gasit==0) g << -1;
return 0;
}