def fun(s): s += f"_{t}" * n return s s = input() t = input() n = int(input()) print(fun(s))