#include<bits/stdc++.h>
using namespace std;
ifstream fi("DE004.inp");
ofstream fo("DE004.out");
int kt(int x){
int m=x,ans1=0,ans2=1;
while(x!=0){ans1=ans1+(x%10);x=x/10;}
while(m!=0){ans2=ans2*(m%10);m=m/10;}
if(2*ans1==ans2)return 1;
else return 0;
}
int main(){
int a,b,k=0;
fi>>a>>b;
for(int i=a;i<=b;++i)if(kt(i)){fo<<i<<' ';k=1;}
if(!k)fo<<-1;
}
