s = input() t = input() n = int(input()) tn = ("_" + t) * n print(s + tn)