from collections import * import heapq import bisect import itertools INF = float("inf") MOD = 998244353 mod = 998244353 S = input() T = input() N = int(input()) ans = S + ("_" + T) * N print(ans)