23333333333333333
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxn 1005000
char s[maxn],t[maxn],p[maxn];
int p1,p2,p3,top=-,l;
void work(int x)
{
int l=s[x-],r=s[x+],cnt=;
if ((s[x-]<='') && (s[x+]>'')) {t[++top]='-';return;}
if ((s[x-]=='-') || (s[x+]=='-')) {t[++top]='-';return;}
for (int i=l+;i<=r-;i++)
{
for (int j=;j<=p2;j++)
{
if (p1==)
{
p[++cnt]='*';
continue;
}
if ((s[x-]>='') && (s[x-]<=''))
p[++cnt]=i;
else
{
if (p1==) p[++cnt]=i;
else if (p1==) p[++cnt]=i-;
}
}
}
if (p3==)
{
for (int i=;i<=cnt;i++)
t[++top]=p[i];
}
else
{
for (int i=;i<=cnt;i++)
t[++top]=p[cnt-i+];
}
}
int main()
{
scanf("%d%d%d",&p1,&p2,&p3);
scanf("%s",s);
l=strlen(s);
for (int i=;i<l;i++)
{
if (s[i]!='-')
t[++top]=s[i];
else
{
if (i==) {t[++top]='-';continue;}
if (i==l-) {t[++top]='-';continue;}
if (s[i-]==s[i+]) t[++top]=s[i];
else if (s[i-]>s[i+]) t[++top]=s[i];
else work(i);
}
}
printf("%s",t);
return ;
}