#include <bits/stdc++.h>
using namespace std;
int a[1000005];
int ws(int a)
{
long long b=0,c=1;
while(a>10)
{
b++;
a=a/10;
}
for(int i=1;i<=b;i++)
{
c=c*10;
}
return c;
}
int main()
{
int n,m,c;
cin>>n>>m>>c;
if(n==m)
{
cout<<n<<endl;
return 0;
}
long long g,ch1=n,ch2;
for(int i=1;i<=c;i++)
{
g=ws(ch1);
ch2=ch1/10;
ch1=ch1%10;
ch1=(ch1*ch1)%10*g+ch2;
a[i]=ch1;
if(ch1==m)
{
for(int j=1;j<=i;j++)
{
cout<<a[j]<<endl;
}
return 0;
}
}
cout<<-1;
return 0;
}
15错了