#include<iostream>
#include<cstdio>
#include<cctype>
#define isnum(p) isalnum(p)&&(!isalpha(p))
using namespace std;
int p1,p2,p3,l;
string s;
void output(char o,int j)
{
for(int i=0;i<j;i++)putchar(o);
}
void expand(char s,char e)
{
char t;
if(isnum(s))
{
if(p1==3)
{
output('*',(e-s-1)*p2);
}
else
{
if(p3==1)
for(t=s+1;t<e;t++)
output(t,p2);
if(p3==2)
for(t=e-1;t>s;t--)
output(t,p2);
}
}
else
{
if(p1==3)
{
output('*',(e-s-1)*p2);
}
else if(p1==1)
{
if(p3==1)
for(t=s+1;t<e;t++)
output(t,p2);
if(p3==2)
for(t=e-1;t>s;t--)
output(t,p2);
}
else if(p1==2)
{
if(p3==1)
for(t=s+1;t<e;t++)
output(t-32,p2);
if(p3==2)
for(t=e-1;t>s;t--)
output(t-32,p2);
}
}
}
int main()
{
int i;
cin>>p1>>p2>>p3>>s;
l=s.size();
for(int i=0;i<l;i++)
{
bool out=1;
bool clr=0;
if(i>0 && i<l-1 && s[i]=='-')
{
if(s[i-1]+1==s[i+1])
{
clr=1;
}
else if(i==1)
{
if(isnum(s[i-1])&&isnum(s[i+1]))
if(s[i-1]<s[i+1])
{
expand(s[i-1],s[i+1]);
out=0;
}
if(isalpha(s[i-1])&&isalpha(s[i+1]))
if(s[i-1]<s[i+1])
{
expand(s[i-1],s[i+1]);
out=0;
}
}
else
{
if(s[i-2]!='#')
{
if(isnum(s[i-1])&&isnum(s[i+1]))
if(s[i-1]<s[i+1])
{
expand(s[i-1],s[i+1]);
out=0;
}
if(isalpha(s[i-1])&&isalpha(s[i+1]))
if(s[i-1]<s[i+1])
{
expand(s[i-1],s[i+1]);
out=0;
}
}
}
}
if(!clr)
out?putchar(s[i]):s[i]='#';
}
}