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