# string of alphabets S , T and positive integers N. is given for S , at the end _and T is The operation to add N times. Print the string that has been done s = input() t = input() n = int(input()) ans = [] while n >0: g = '_' ans.append(s) ans.append(g) ans.append(t) n-=1 print(''.join(ans))