import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N = I() S = [S()+'{' for _ in range(N)] ANS = [] while True: S.sort() if S[0] == '{': break ANS.append(S[0][0]) new_S = [S[0][1:]] for s in S[1:]: new_S.append(s) S = new_S ans = ''.join(ANS) print(ans)