def main(): s = input() t = input() n = int(input()) print(s+("_"+t)*n) if __name__ == '__main__': main()