if __name__ == "__main__": a = input() b = input() c = int(input()) answer = [a] for _ in range(c): answer.append("_") answer.append(b) print("".join(answer))