#include
#include
int main(void)
{
int looptimes, ri;
int i,a,m,n;
int top,low;
int result[10] = {0};
scanf("%d",&looptimes);
for(ri = 1; ri <= looptimes; ri++)
{
scanf("%d%d%d",&a,&n,&m);
top=0;
low=0;
for(i=0; i
{
low = (a*(n-i)+ top)%10;
top = (a*(n-i)+ top)/10;
result[m-i-1] = low;
}
for(i=0; i
{
printf("%d",result[i]);
}
printf("n");
}
return 0;
}