S = input() T = input() N = int(input().strip()) ans = S + '_' + '_'.join([T for _ in range(N)]) print(ans)