//1.7.35
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
bool iszimu(char a){
if(a>='a'&&a<='z') return true;
return 0;
}
void solve(string &s,int p1,int p2,int p3){
if(p1==1)
{
for(int i=0;i<s.length();i++)
{
if(s[i]=='-')
{
if(iszimu(s[i-1])&&iszimu(s[i+1])&&s[i+1]>s[i-1]+1)
{
if(p3==1)
{
for(char temp = s[i-1]+1;temp<s[i+1];temp++)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
else
{
for(char temp = s[i+1]-1;temp>=s[i-1]+1;temp--)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
continue;
}
else if(isdigit(s[i-1])&&isdigit(s[i+1])&&s[i+1]>s[i-1]+1)
{
if(p3==1)
{
for(char temp = s[i-1]+1;temp<s[i+1];temp++)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
else
{
for(char temp = s[i+1]-1;temp>=s[i-1]+1;temp--)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
continue;
}
else if(s[i-1]>=s[i+1] ) cout<<'-';
else if(s[i-1]+1==s[i+1]);
else cout<<'-';//刚开始没有这个,如果s-2这种就会出错(少一个-)
}
else
cout<<s[i];
}
cout<<endl;
}
else if(p1==2)
{
for(int i=0;i<s.length();i++)
{
if(s[i]=='-')
{
if(iszimu(s[i-1])&&iszimu(s[i+1])&&s[i+1]>s[i-1]+1)
{
if(p3==1)
{
for(char temp = s[i-1]+1-('a'-'A');temp<s[i+1]-('a'-'A');temp++)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
else
{
for(char temp = s[i+1]-1-('a'-'A');temp>=s[i-1]+1-('a'-'A');temp--)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
continue;
}
else if(isdigit(s[i-1])&&isdigit(s[i+1])&&s[i+1]>s[i-1]+1)
{
if(p3==1)
{
for(char temp = s[i-1]+1;temp<s[i+1];temp++)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
else
{
for(char temp = s[i+1]-1;temp>=s[i-1]+1;temp--)
{
for(int j=0;j<p2;j++) cout<<temp;
}
}
continue;
}
else if(s[i-1]>=s[i+1] ) cout<<'-';
else if(s[i-1]+1==s[i+1]);
else cout<<'-';
}
else
cout<<s[i];
}
printf("
");
}
else
{
for(int i=0;i<s.length();i++)
{
if(s[i]=='-')
{
if(iszimu(s[i-1])&&iszimu(s[i+1])&&s[i+1]>s[i-1]+1)
{
for(char temp = s[i-1]+1;temp<s[i+1];temp++)
{
for(int j=0;j<p2;j++) cout<<'*';
}
continue;
}
else if(isdigit(s[i-1])&&isdigit(s[i+1])&&s[i+1]>s[i-1]+1)
{
for(char temp = s[i-1]+1;temp<s[i+1];temp++)
{
for(int j=0;j<p2;j++) cout<<'*';
}
continue;
}
else if(s[i-1]>=s[i+1] ) cout<<'-';
else if(s[i-1]+1==s[i+1]);
else cout<<'-';
}
else
cout<<s[i];
}
cout<<endl;
}
}
int main(){
int p1,p2,p3;
string s;
while(cin>>p1>>p2>>p3)
{
cin>>s;
solve(s,p1,p2,p3);
}
return 0;
}