#include<bits/stdc++.h>
using namespace std;

int p1, p2, p3;
string str;

int judge(int i)
{
	if(str[i] >= 'a' && str[i] <= 'z')
		return 1;
	else if(str[i] >= '0' && str[i] <= '9')
		return 2;
	else
		return 3;
}

void expand(int p)
{
	if(str[p + 1] <= str[p - 1])
	{
		return;
	}
	else
	{
		if(str[p - 1] + 1 == str[p + 1])
		{
			str.erase(p, 1);
		}
		else
		{
			if(p1 == 3)
			{
				string s;
				for(int i = 0; i < (str[p + 1] - str[p - 1] - 1) * p2; i++)
				{
					s += '*';
				}
				str.replace(p, 1, s);
			}
			else
			{
				if(p1 == 2 && judge(p - 1) == 1)
				{
					int temp = 'A' - 'a';
					string s;
					if(p3 == 1)
					{
						for(char i = str[p - 1] + 1 + temp; i < str[p + 1] + temp; i++)
						{
							for(int j = 0; j < p2; j++)
							{
								s += i;
							}
						}
					}
					else
					{
						for(char i = str[p + 1] - 1 + temp; i > str[p - 1] + temp; i--)
						{
							for(int j = 0; j < p2; j++)
							{
								s += i;
							}
						}
					}
					str.replace(p, 1, s);
				}
				else
				{
					string s;
					if(p3 == 1)
					{
						for(char i = str[p - 1] + 1; i < str[p + 1]; i++)
						{
							for(int j = 0; j < p2; j++)
							{
								s += i;
							}
						}
					}
					else
					{
						for(char i = str[p + 1] - 1; i > str[p - 1]; i--)
						{
							for(int j = 0; j < p2; j++)
							{
								s += i;
							}
						}
					}
					str.replace(p, 1, s);
				}
			}
		}
	}
}

int main()
{
	cin >> p1 >> p2 >> p3;
	cin >> str;
	for(int i = 0; i < str.size(); i++)
	{
		if(str[i] == '-' && i != 0 && i != str.size() - 1)
		{
			if(judge(i - 1) == judge(i + 1) && judge(i - 1) != 3)
			{
				expand(i);
			}
		}
	}
	cout << str << endl;
	return 0;
}