#include<iostream>
using namespace std;
int main()
{
for(int a=1;a<10;a++)
for(int b=1;b<10;b++)
for(int c=1;c<10;c++)
for(int d=1;d<10;d++)
for(int e=1;e<10;e++)
if((a*10000+b*1000+c*100+d*10+e)*(a)==(e*100000+e*10000+e*1000+e*100+e*10+e))
if(a!=b || a!=c || a!=d || a!=e)
if(b!=c || b!=d || a!=e)
if(c!=d || c!=e)
if(d!=e)
cout<<"A= "<<a<<" B= "<<b<<" C= "<<c<<" D= "<<d<<" E= "<<e<<endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkKewogICBmb3IoaW50IGE9MTthPDEwO2ErKykKICAgZm9yKGludCBiPTE7YjwxMDtiKyspCiAgIGZvcihpbnQgYz0xO2M8MTA7YysrKQogICBmb3IoaW50IGQ9MTtkPDEwO2QrKykKICAgZm9yKGludCBlPTE7ZTwxMDtlKyspCiAgICAgIGlmKChhKjEwMDAwK2IqMTAwMCtjKjEwMCtkKjEwK2UpKihhKT09KGUqMTAwMDAwK2UqMTAwMDArZSoxMDAwK2UqMTAwK2UqMTArZSkpCiAgICAgIGlmKGEhPWIgfHwgYSE9YyB8fCBhIT1kIHx8IGEhPWUpCiAgICAgIGlmKGIhPWMgfHwgYiE9ZCB8fCBhIT1lKQogICAgICBpZihjIT1kIHx8IGMhPWUpCiAgICAgIGlmKGQhPWUpCiAgICAgICAgY291dDw8IkE9ICI8PGE8PCIgIEI9ICI8PGI8PCIgIEM9ICI8PGM8PCIgIEQ9ICI8PGQ8PCIgIEU9ICI8PGU8PGVuZGw7CiAgIHJldHVybiAwOwp9Cg==