p1, p2, p3 = map(int, input().split())
s = input()

ans = ""
for i, ch in enumerate(s):
    if ch == '-' and 0 < i < len(s) - 1:  # 扩展
        prev = s[i - 1]; nxt = s[i + 1]
        if ord(prev) + 1 == ord(nxt):  # 只需删除 '-' 即可
            continue

        check1 = prev.islower() and nxt.islower()  # 小写字母
        check2 = prev.isdigit() and nxt.isdigit()  # 数字
        if not ((check1 or check2) and prev < nxt):  # 无效扩展
            ans += ch
            continue

        res = ""  # 构造增加字符
        for j in range(ord(prev) + 1, ord(nxt)):
            if p1 == 3:
                res += '*' * p2
            elif p1 == 2 and check1:  # 大写字母
                res += chr(j - 32) * p2
            else:  # 数字或小写字母
                res += chr(j) * p2

        ans += res if p3 == 1 else res[::-1]
    else:
        ans += ch

print(ans)