#include<iostream>
#include<string>
using namespace std;
string str,s;
int p1,p2,p3;
void rep(int i){
if(p1 == 1){
if(p3 == 1){
char c = str[i-1] + 1;
for(int j = i; c!=str[i+1]; j++){
for(int q = 0; q < p2; q++){
s += c;
}
c = c + 1;
}
}else if(p3 == 2){
char c = str[i+1] - 1;
for(int j = i; c!=str[i-1]; j++){
for(int q = 0; q < p2; q++){
s += c;
}
c = c - 1;
}
}
}else if(p1 == 2){
if(p3 == 1){
char c = str[i-1] + 1 - 32;
for(int j = i; c!=str[i+1] - 32; j++){
for(int q = 0; q < p2; q++){
s += c;
}
c = c + 1;
}
}else if(p3 == 2){
char c = str[i+1] - 1 - 32;
for(int j = i; c!=str[i-1] - 32; j++){
for(int q = 0; q < p2; q++){
s += c;
}
c = c - 1;
}
}
}else if(p1 == 3){
char c = str[i-1] + 1;
for(int j = i; c!=str[i+1]; j++){
for(int q = 0; q < p2; q++){
s += '*';
}
c = c + 1;
}
}
}
int main(){
cin>>p1>>p2>>p3;
getchar();
getline(cin,str);
for(int i = 0;i<str.length();i++){
if(str[i] != '-'){
str = str.substr(i);
break;
}
}
for(int i=0;i<str.length();i++){
if(str[i] == '-'){
if(str[i-1] >= str[i+1]){
s += str[i];
continue;
}else if(str[i-1] < str[i+1]){
rep(i);
continue;
}
}
s += str[i];
}
cout<<s;
return 0;
}