#include <iostream>
#include <string>
using namespace std;
int p,q,r,tmp=2;
string str;
void init();
void work();
void print();
char big(char c);
char small(char c);
int type(char c);
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
init();
work();
print();
return 0;
}
void init(){
cin >> p >> q >> r >> str;
}
void work(){
for (int i=0;i<str.length();i++){
if (str[i] == '-'){
if (str[i-1] >= str[i+1]) continue;
else if (type(str[i-1]) != type(str[i+1])) continue;
else if (str[i-1] == str[i+1] - 1) str.erase(i,1);
else{
str.erase(i,1);
if (p == 3) str.insert(i,(str[i]-str[i-1]) * q,'*');
else{
char sta = str[i-1];
char end = str[i];
if (r == 2)
for (int j=sta+1;j<end;j++){
if (p == 2) str.insert(i,q,big(char(j)));
if (p == 1) str.insert(i,q,small(char(j)));
}
else if (r == 1)
for (int j=end-1;j>sta;j--){
if (p == 2) str.insert(i,q,big(char(j)));
if (p == 1) str.insert(i,q,small(char(j)));
}
}
}
}
}
}
void print(){
cout << str;
}
char big(char c){
if (c >= 'a' && c <= 'z') c -= 'a' - 'A';
return c;
}
char small(char c){
if (c >= 'A' && c <= 'Z') c += 'a' - 'A';
return c;
}
int type(char c){
if (c >= '0' && c <= '9') return 0;
else if (c >= 'a' && c <= 'z') return 1;
else return tmp++;
}