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