N = int(input()) strings = [] for x in range(N): strings.append(input()) ans = "" def cut(str): return str[1:] while ( all( x == "" for x in strings) ): min = strings[0] for x in strings: if (min[0] > x[0]): min = x ans.append(min[0]) strings[strings.index(min)] = cut(min) print(ans)