# import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') from collections import * from itertools import * from functools import * from heapq import * import sys,math # input = sys.stdin.readline S = input() T = input() N = int(input()) T = '_'+T print(S+T*N)