#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
for (int i = a; i <= b; i++)
int ii = i;
while (ii / 10 != 0)
ii =ii / 10;
if (i % ii == 0) { cout << i << endl; }
}
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
for (int i = a; i <= b; i++)
{
int ii = i;
while (ii / 10 != 0)
ii =ii / 10;
if (i % ii == 0) { cout << i << endl; }
}
}