#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char ch[110],c;
int p1,p2,p3;
int main()
{
freopen("expand.in","r",stdin);
freopen("expand.out","w",stdout);
scanf("%d%d%d",&p1,&p2,&p3);getchar();
c=getchar();
int ji=0;
while (c!=EOF)
{
ch[++ji]=c;
c=getchar();
}
for (int i=1;i<=ji;++i)
{
if (ch[i]=='-')
{
if (ch[i-1]==ch[i+1]||ch[i-1]>ch[i+1]) {printf("%c",ch[i]);continue;}
else if (ch[i-1]>='0'&&ch[i+1]<='9')
{
if (p1==3)
for (int j=ch[i-1]+1;j<ch[i+1];++j)
for (int k=1;k<=p2;++k) printf("*");
else
{
if (p3==1)
for (int j=ch[i-1]+1;j<ch[i+1];++j)
for (int k=1;k<=p2;++k)
printf("%c",j);
else
for (int j=ch[i+1]-1;j>ch[i-1];--j)
for (int k=1;k<=p2;++k)
printf("%c",j);
}
}
else if (ch[i-1]>='a'&&ch[i+1]<='z')
{
if (p1==3)
for (int j=ch[i-1]+1;j<ch[i+1];++j)
for (int k=1;k<=p2;++k) printf("*");
else
{
if (p1==2) ch[i]=-32;else ch[i]=0;
if (p3==1)
for (int j=ch[i-1]+1;j<ch[i+1];++j)
for (int k=1;k<=p2;++k)
printf("%c",ch[i]+j);
else
for (int j=ch[i+1]-1;j>ch[i-1];--j)
for (int k=1;k<=p2;++k)
printf("%c",ch[i]+j);
}
}
else {printf("%c",ch[i]);continue;}
}
else printf("%c",ch[i]);
}
return 0;
}