rt
#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
const int N=1e2+5,INF=0x3f3f3f3f;
int n,m,k;
int a[N];
int f(int x)
{
int res=0;
for(int i=k;i>=1;i--)
{
res+=(a[i]*pow(x,k));
}
res+=a[0];
return res;
}
signed main()
{
scanf("%lld%lld%lld",&n,&m,&k);
for(int i=0;i<=k;i++)
cin>>a[i];
for(int y=m-1;y>=0;y--)
{
for(int x=0;x<n;x++)
{
if(f(x)==y)
cout<<'*';
else
cout<<'.';
}
putchar('\n');
}
return 0;
}