# coding: utf-8 # Your code here! n = int(input()) lst = [] t = "" s_length = 0 for i in range(n): s = input() s_length += len(s) lst.append(s+"z") for i in range(s_length): lst.sort() t += lst[0][0] if len(lst[0])==2: del lst[0] else: lst[0] = lst[0][1:] print(t)