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