import sys n = int(input()) l = sys.stdin.read().split() T = "" l = sorted(l, key=lambda x: x[0]) while len(l[0]) > 0: T += l[0][0] l[0] = l[0][1:] if "" in l: l.remove("") if len(l) == 0: break l = sorted(l, key=lambda x: x[0]) print(T)