s = input() t = '_' + input() n = int(input()) print(f"{s}{t*n}")