Problem:
 Score : 200 points    Problem Statement Iroha has a sequence of N strings S_1, S_2, ..., S_N . The length of each string is L .  She will concatenate all of the strings in some order, to produce a long string.  Among all strings that she can produce in this way, find the lexicographically smallest one.  Here, a string s=s_1s_2s_3 ... s_n is lexicographically smaller than another string t=t_1t_2t_3 ... t_m if and only if one of the following holds:  There exists an index i(1≦i≦min(n,m)) , such that s_j = t_j for all indices j(1≦j<i) , and s_i<t_i .  s_i = t_i for all integers i(1≦i≦min(n,m)) , and n<m .       Constraints  1 ≦ N, L ≦ 100  For each i , the length of S_i equals L .  For each i , S_i consists of lowercase letters.         Input The input is given from Standard Input in the following format:  N  L  S_1  S_2 : S_N       Output Print the lexicographically smallest string that Iroha can produce.        Sample Input 1 3 3
dxx
axx
cxx      Sample Output 1 axxcxxdxx  The following order should be used: axx , cxx , dxx .

Solution (Python):
N, L = map(int, input().split())
S = [input() for i in range(N)]

S_sort = sorted(S)

print(''.join(S_sort))

Solution (Python):
N,L = map(int, raw_input().split())
a = []
s = ""
for i in range(N):
    b = raw_input()
    a.append(b)
a.sort()
for i in range(N):
    s += a[i] 
print s

Solution (Python):
N, L = [int(x) for x in input().split()]
print("".join(sorted([input() for i in range(N)])))

Solution (Python):


if __name__ == "__main__":
    
    raw = input()
    N, L = [int(f) for f in raw.split(" ")]
    
    str_list = []
    for i in range(N):
        raw = input()
        str_list.append(raw)
        
    sorted_str = sorted(str_list)
    join_str = "".join(sorted_str)
    
    print(join_str)

Solution (Python):
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S2 = sorted(S)
mojiretsu = ''.join(S2)
print(mojiretsu)

Solution (Python):
s = input().rstrip().split(" ")
t = []
for i in range(int(s[0])):
    t.append(input())
print("".join(sorted(t)))

Solution (Python):
n,l = map(int,input().split())

s = sorted([input() for i in range(n)])

print(*s,sep="")

Solution (Python):
n, l = map(int, input().split())
s = []

for _ in range(n):
    s.append(input())
s.sort()
print(''.join(s))

Solution (Python):
i = input().split()
s, t = map(int, i)
str_list = []

for i in range(s):
    string = input()
    str_list.append(string)

str_list.sort()
ans = ''.join(str_list)

print(ans)

Solution (Python):
n, l = map(int, input().split())
ss = [input() for _ in range(n)]
print(''.join(sorted(ss)))

Solution (Python):
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S2 = sorted(S)
mojiretsu = ''.join(S2)
print(mojiretsu)

Solution (Python):
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S2 = sorted(S)
mojiretsu = ''.join(S2)
print(mojiretsu)

Solution (Python):
N, _ = map(int, input().split())
l_list = [str(input()) for i in range(N)]
l_list = sorted(l_list)
ans = ''.join(l_list)
print(ans)

Solution (Python):
n,l=map(int,input().split())
s=[]
for i in range(n):
	s.append(input())
s.sort()
d=""
for i in range(len(s)):
	d+=s[i]
print(d)

Solution (Python):

import sys
sys.setrecursionlimit(300000)


def solve(N: int, L: int, S: "List[str]"):
    S.sort()
    ret = ''.join(S)
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    L = int(next(tokens))  
    S = [ next(tokens) for _ in range(N) ]  
    solve(N, L, S)

if __name__ == '__main__':
    main()

Solution (Python):
N,L = list(map(int,input().split()))

char_list = [input() for i in range(N)]
char_list.sort()
print(''.join(char_list))

Solution (Python):
n, l = map( int, input().split( ' ' ) )
strs = sorted( [ input() for i in range(n) ] )
print( ''.join( strs ) )

Solution (Python):
N, L = map(int, input().split())
S = []
for i in range(N):
    S.append(input())

S.sort()
for s in S:
    print(s, end='')
print()

Solution (Python):
x,y = map(int,input().split())
a = [input() for i in range(x)]
a = sorted(a)
print(''.join(a))

Solution (Python):
n, l = input().split()
a = [input() for i in range(int(n))]
a.sort()
print('{}'.format(''.join(a)))

Solution (Python):
n, l = map(int, input().split(" "))
s = sorted([input() for i in range(n)])
print("".join(s))

Solution (Python):

n, l = [int(el) for el in input().split(' ')]
S = sorted([input() for i in range(n)])
print(''.join(S))

Solution (Python):

n, l = map(int, input().split())
s = sorted([input() for i in range(n)])
print("".join(s))

Solution (Python):
N, L = map(int, input().split())
P = [input() for i in range(N)]
P.sort()
print("".join(P))

Solution (Python):

N,L=map(int,input().split())

l=[]
for i in range(N):
  l.append(input())


l.sort()


print(''.join(l))

Solution (Python):
n, length = map(int, input().split())
s_list = [input() for i in range(n)]


s_str = ''.join(sorted(s_list))
print(s_str)

Solution (Python):
n, l = map(int, input().split())
s_list = []
for i in range(n):
    s_list.append(input())


s_str = ''.join(sorted(s_list))
print(s_str)

Solution (Python):
num_word, word_length = map(int, input().split())
li_word = [input() for i in range(num_word)]

sorted_li = sorted(li_word)
con_word = ""
for i in range(num_word):
    con_word += sorted_li[i]
print(con_word)

Solution (Python):
N,L=map(int,input().split())
S=[]
S_list=[]
for i in range(N):
    S.append(input())
S.sort()
print(''.join(S))

Solution (Python):
n,l=map(int,input().split())
s=list(input() for i in range(n))
print(''.join(sorted(s)))

Solution (Python):
N,L = map(int,input().split())
S=[]
for n in range(N):
    S.append(input())
print("".join(sorted(S)))

Solution (Python):
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
print(*S, sep='')

Solution (Python):
tmp = input()
N = int(tmp.split(" ")[0])
L = int(tmp.split(" ")[1])
S = []

for i in range(N):
    S.append(input())

S.sort()
output = ""
for i in range(N):
    output = output + S[i]

print(output)

Solution (Python):
n,l=map(int,input().split())
input_str = []
for i in range(n):
    input_str.append(input())
input_str.sort()

mojiretu = ''.join(input_str) 
print(mojiretu)

Solution (Python):
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Solution (Python):
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())
print(''.join(sorted(s)))

Solution (Python):
n, l = map(int, input().split())
s_list = sorted([input() for i in range(n)])
mojiretu = ''.join(s_list)
print(mojiretu)

Solution (Python):
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print("".join(s))

Solution (Python):



if __name__ == '__main__':
    n, l = map(int, input().split())
    s = sorted([input() for _ in range(n)])
    print(''.join(s))

Solution (Python):
N,L=list(map(int, input().split()))
s=[input() for i in range(N)]

s=sorted(s)
out="".join(s)
print(out)

Solution (Python):
n,l=map(int,input().split())

string=[]
for s in range(n):
    string.append(str(input()))
string.sort()
print(''.join(string))

Solution (Python):
n, l = map(int, input().split())
x = []
for i in range(n):
  x.append(input())
  
x = sorted(x)
print("".join(x))

Solution (Python):
N, L = map(int, input().split())
str_list = [input() for _ in range(N)]
str_list.sort()
print(''.join(str_list))

Solution (Python):
n, l = list(map(int, input().split()))
s = [input() for i in range(n)]
s.sort()
ss = ''
for i in range(n):
	ss += s[i]
print(ss)

Solution (Python):

Tmp = []
Tmp = input().rstrip().split(' ')

nN = int(Tmp[0])
nL = int(Tmp[1])

sWord = []

for i in range(nN):
  S = input()
  sWord.append(S)

sWord.sort()

for i in range(nN):
  print('%s' %(sWord[i]), end='')

print()

Solution (Python):
N,L=map(int,input().split())
s=[]

for i in range(N):
  s.append(input())

s.sort()

result=""
for i in range(N):
	result+=s[i]
print(result)

Solution (Python):

def main():
    num, length = map(int, input().split())
    data = [input() for i in range(num)]
    data.sort()
    print(''.join(data))


if __name__ == '__main__':
    main()

Solution (Python):
N,L = map(int,input().split())
sentences = []
for i in range(N):
    s = input().rstrip('\n')
    sentences.append(s)

ans =[]
count = 0
while len(sentences)>0:
    add = min(sentences)
    sentences.remove(add)
    ans.append(add)
print("".join(ans))

Solution (Python):
n, l = map(int, input().split())
s = [str(input()) for i in range(n)]
s.sort()
print(''.join(s))

Solution (Python):
n, l = map(int, input().split())
print(''.join(sorted([input() for i in range(n)])))

Solution (Python):
N,L = map(int,input().split())
s = [input() for i in range(N)]

s.sort()

ans =""

for i in range(N):
    ans += s[i]

print(ans)

Solution (Python):
n,l = map(int,input().split())
s = []
for i in range(n):
    s.append(input())
s.sort()
ans = ''
for i in s:
    ans += i
print(ans)

Solution (Python):
n = input()
n = n.split(" ")
L = n[1]
N = n[0]

s = [input() for i in range(int(N))]
s.sort()
result = ''
for si in s:
    result += si
print(result)

Solution (Python):
n1,n2 = map(int, input().split())

s = [input() for i in range(n1)]

s.sort()

result = ''
for si in s:
    result += si

print(result)

Solution (Python):
n,l =map(int,input().split())
x = sorted(input() for _ in range(n))
print(*x,sep="")

Solution (Python):
n,l = map(int,input().split())
s = sorted([input() for _ in range(n)])
print("".join(s))

Solution (Python):
N, L = map(int, input().split())
S = [0] * N
for i in range(N):
    S[i] = input()

S.sort()

print(''.join(S))

Solution (Python):
n,j = map(int,input().split())
l = []
for i in range(n):
  l.append(str(input()))
l.sort()
print(''.join(l))

Solution (Python):

def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('a')+1)
    return num

def string2num(str):
    _N = len(str)
    num=0
    for n in range(_N):
        num+=alpha2num(str[n])* (26**(_N-1-n))
    return num

if __name__ == "__main__":
    N,L = (int(x) for x in input().split())
    S = []
    S2Num=[]
    for n in range(N):
        _str = input()
        S.append(_str)
        S2Num.append(string2num(_str))
    ans =""
    for key in sorted(range(len(S2Num)), key=lambda k: S2Num[k]):
        ans+=S[key]
    print(ans)

Solution (Python):
a,b=map(int,input().split())
x=[]
for i in range(a):
    x.append(input())
l=sorted(x)
tmp=""
for i in l:
    tmp+=i
print(tmp)

Solution (Python):
N,L = map(int,input().split())
S=[]
for i in range(N):
  S.append(input())
S.sort()
ans="".join(S)
print(ans)

Solution (Python):

"""
Created on Fri Jul 26 04:05:59 2019

@author: matsui
"""
N,L=map(int,input().split())

abc=[chr(i) for i in range(97,123)]
s=list()
for i in range(N):
    s.append(input())
    
s.sort()
ans=''
for i in range(N):
    ans+=s[i]
        
        
print(ans)

Solution (Python):
n, l = map(int, input().split())
S = [input() for _ in range(n)]
S.sort()
print("".join(S))

Solution (Python):
N, L = map(int, input().split())
S = [0] * N

for n in range(N):
    S[n] = [_ for _ in input()]

S = sorted(S, key=lambda x: [x[i] for i in range(L)])

ans = ''
for item in S:
    ans += ''.join(item)
print(ans)

Solution (Python):
str = input().split()
v=""
sa=list()
for i in range(int(str[0])):
    sa.append(input()[:int(str[1])])
sa.sort()
for i in sa:
    v=v+i

print(v)

Solution (Python):
n, l = map(int, input().split())
a = [input() for _ in range(n)]
a = sorted(a)
ans = ""
for s in a:
  ans += s
print(ans)

Solution (Python):
n,l = map(int,input().split())
mylist=sorted([input() for i in range(n)])
print("".join(mylist))

Solution (Python):
N, L = map(int, input().split())
S = [str(input()) for _ in range(N)]
S.sort()
for i in S:
    print (i, end = '')
print()

Solution (Python):
n, l = map(int, input().split())
s = sorted([input() for _ in range(n)])
print("".join(s))

Solution (Python):
N,L=map(int,input().split())
S=sorted(list(input() for _ in range(N)))
print("".join(S))

Solution (Python):
N,L = map(int, input().split())
S = [input() for i in range(N)]
Ss = sorted(S)
print(''.join(Ss))

Solution (Python):
N,L = list(map(int,input().split()))
S = sorted([(input()) for i in range(N)])
print("".join(S))

Solution (Python):
n, l = map(int, input().split())
s = []
for i in range(n):
  s.append(input())
s.sort()
ans = ""
for i in range(n):
  ans += s[i]
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, l = map(int, input().split())
s = []
for _ in range(n):
    s.append(input().split("\n")[0])
s.sort()

print(*s, sep="")

Solution (Python):
n,l=map(int,input().split())
s=[]
res=''
for i in range(n):
  s.append(input())
s.sort()
for k in range(n):
  res+=s[k]
print(res)

Solution (Python):
N,L=[int(x) for x in input().split()]
s=[]
for _ in range(N):
  s.append(input())
s.sort()
print("".join(s))

Solution (Python):
N, L = map(int, input().split())
lst = []
for _ in range(N):
  lst.append(input())
lst.sort()
print(''.join(lst))

Solution (Python):
n, l = map(int, input().split())
S = list()
result = ''
while n > 0:
    S.append(input())
    n -= 1

for i in sorted(S):
    result += i 

print(result)

Solution (Python):
n, l = map(int, input().split())
list = []
for i in range(n):
  list.append(input())
list.sort()
print("".join(list))

Solution (Python):
n, l = map(int, input().split())

s = [input() for i in range(n)]

print("".join(sorted(s)))

Solution (Python):
N,L=input().split()
N=int(N)
L=int(L)
S=[input() for i in range(N)]
S.sort()
str=""
for j in range(N):
    str=str+S[j]
print(str)

Solution (Python):
N,L = [int(i) for i in input().split()]
S = []
for i in range(N):
    S.append(input())
S_sorted = sorted(S)
print(''.join(S_sorted))

Solution (Python):
n, l = map(int, input().split())
s = []
for i in range(n):
  s.append(input())
s.sort()
print(''.join(s))

Solution (Python):
a, b = map(int, input().split())
c = [input() for _ in range(a)]
c.sort()
print("".join(c))

Solution (Python):

N,L = map(int,input().split())
S = []

for i in range(N):

    s = input()
    S.append(s)

S.sort()

print ("".join(S))

Solution (Python):
n,l = map(int, input().split())
li = sorted([input() for x in range(n)])
s = ""
for i in range(n):
    s += li[i]
print(s)

Solution (Python):
N,L = map(int,input().split())
S =[input() for i in range(N)]
S.sort()
A = ""
for i in range(N):
    A = A + S[i]
print(A)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a = LI()
    a.sort()
    if a == [5, 5, 7]:
        print("YES")
    else:
        print("NO")
    return


def B():
    n, l = LI()
    s = SR(n)
    s.sort()
    for i in s:
        print("".join(i), end="")
    print()
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    B()

Solution (Python):
N, L = map(int, input().split())
S = []
for i in range(0, N):
	S.append(input())
S.sort()
ans = ''
for i in range(0, N):
	ans = ans + S[i]
print(ans)

Solution (Python):
N, L = map(int, input().split())
A = map(str,list(input() for _ in range(N)))
B = sorted(A)

print(''.join(B))

Solution (Python):
N, L = map(int, input().split())
string = [input() for _ in range(N)]
string.sort()
print("".join(string))

Solution (Python):



number, length = map(int, input().split())
lst = []
for n in range(number):
    s = input()
    
    lst.append(s)
    

lst.sort()
moji = ""
for n in lst:
    moji += n
print(moji)

Solution (Python):
N, L = map(int, input().split())
S = []
for i in range(N):
    s = input()
    S.append(s)
S.sort()
print(''.join(S))

Solution (Python):
N, L = map(int, input().split())
S = [input() for i in range(N)]
S = sorted(S)

print("".join(S))

Solution (Python):
x,y=map(int,input().split())
print("".join(sorted([input() for _ in range(x)])))

Solution (Python):
import sys

def main():
    N, L = map(int, input().split())
    S = []
    for i in range(N):
        S.append(input())
    S.sort()
    print(''.join(S))



if __name__ == "__main__":
    main()

Solution (Python):
n,L=map(int,input().split())
l=sorted([input() for i in range(n)])
for t in l:print(t,end='')

Solution (Python):


def main():
    N, L = map( int, input().split())
    S = [ input() for _ in range(N)]
    S.sort()
    V = [1]*N
    print("".join(S))

if __name__ == '__main__':
    main()

Solution (Python):
N, L = map(int, input().split())
L = [str(input()) for i in range(N)]
L.sort()
A = str()
for word in L:
  A += word
print(A)

Solution (Python):
ilist = input().split(' ')
n = int(ilist[0])
l = int(ilist[1])

strlist = list()

for i in range(0,n):
	strlist.append(input())

strlist.sort()

answer = ''
for s in strlist:
	answer = answer + s

print(answer)

Solution (Python):
from sys import stdin
N,L = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(N):
    data.append((input()))
print("".join(sorted(data)))

Solution (Python):
n,l = map(int, input().split())
ls = sorted([input() for i in range(n)])
print(''.join(ls))

Solution (Python):
Num = [int(n) for n in input().rstrip().split()]

Str = [input().rstrip() for _ in range(Num[0])]

print("".join(sorted(Str)))

Solution (Python):
a, b = map(int, input().split())
c = []
for i in range(a):
    c.append(input())
c.sort()
print("".join(c))

Solution (Python):
n,l = map(int,input().split())
s = sorted([input() for _ in range(n)])
print("".join(s))

Solution (Python):
N,L = map(int,input().split())
print(''.join(sorted([input() for i in range(N)])))

Solution (Python):
print("".join(sorted([input()for _ in range(int(input().split()[0]))])))

Solution (Python):
N,L=map(int,input().split())
print("".join(sorted([input() for _ in range(N)])))

Solution (Python):
N, L = [int(s) for s in input().split(' ')]

S = [input() for i in range(N)]

S = ''.join(list(sorted(S)))

print(S)

Solution (Python):
n, _ = map(int, input().split())
print(''.join(sorted([input() for _ in range(n)])))

Solution (Python):
n, l = map(int, input().split())
s = [input() for i in range(n)]
s = sorted(s)
print(''.join(s))

Solution (Python):
N, L = map(int, input().split())
S  = []

for i in range(N):
    S.append(input())

S.sort()

ans = ''
for i in range(N):
    ans += S[i]

print(ans)

Solution (Python):
n, l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
for i in s:
    print(i, end='')
print()

Solution (Python):
n,l=map(int,input().split())
s=[input() for i in range(n)]
s.sort()
print("".join(s))

Solution (Python):
n, l = map(int, input().split())
s_list = [input() for i in range(n)]

sum_s = ''
for s in sorted(s_list):
    sum_s += s
print(sum_s)

Solution (Python):
N, L = map(int, input().split())
S = [input() for _ in range(N)]

S.sort()
print(''.join(S))

Solution (Python):
import numpy as np

n,l = map(int,input().split())
arr = []
for i in range(n):
    arr.append((input()))

arr.sort()

ans = ""

for i in range(n):
    ans += arr[i]

print(ans)

Solution (Python):
N, L = map(int,input().split())
a = []
for i in range(N):
  a.append(input())
a = sorted(a)
print(''.join(a))

Solution (Python):


n,l = map(int,input().split())
s = [input() for _ in range(n)]
s.sort()
ans = ''
for i in range(n):
    ans += s[i]
print(ans)

Solution (Python):
def main():
    N, L = list(map(int, input().split()))
    s = [input() for _ in range(N)]
    s = "".join(sorted(s))
    print(s)

if __name__ == '__main__':
    main()

Solution (Python):
n, l = input().split()
s = "".join(sorted([input() for _ in range(int(n))]))
print(s)

Solution (Python):



def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, typ=int):
    return [typ(input()) for _ in range(n)]


def main():
    n, l = read_h()
    s = ''.join(sorted(read_v(n, typ=str)))
    print(s)


if __name__ == '__main__':
    main()

Solution (Python):
n,l=map(int,input().split())
s=[]
for i in range(n):
    s.append(input())
s.sort()
sums=''
for i in range(n):
    sums=sums+s[i]
print(sums)

Solution (Python):
from operator import add
from functools import reduce
n, l = list(map(int, input().split()))
s = [input() for _ in range(n)]
s.sort()
ss = reduce(add, s)
print(ss)

Solution (Python):
n, l = (int(x) for x in input().split())
s_list = []
s = ''
for i in range(n):
  s_list.append(input())
for i in range(n):
  s += s_list.pop(s_list.index(min(x for x in s_list)))
print(s)

Solution (Python):
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, L = list(map(int, sys.stdin.readline().split()))
S = [sys.stdin.readline().rstrip() for _ in range(N)]
S.sort()
print(''.join(S))

Solution (Python):
n,l = map(int,input().split())
lst = [input() for i in range(n)]

lst.sort()
ans = ''
for l in lst:
    ans += l
print(ans)

Solution (Python):
N, L = [int(i) for i in input().split()]
s = []
for i in range(N):
    s.append(input())


s_sort = sorted(s)
concat = ''.join(s_sort)
print(concat)

Solution (Python):
n,l = map(int,input().split())
l=[]
for i in range(n):l.append(str(input()))
l=sorted(l)
print(''.join(l))

Solution (Python):
n, l = map(int, input().split(" "))
ss = [input() for i in range(n)]
ss.sort()
print(''.join(ss))

Solution (Python):
N , L= map(int,input().split())
lst = []
for i in range(N):
    lst.append(input())
lst.sort()
Str = ''
for j in range(N):
    Str += lst[j]
print(Str)

Solution (Python):
a = list(map(int,input().split()))
b = [input() for i in range(a[0])]
c = sorted(b)
print("".join(c))

Solution (Python):
n, l = map(int, input().split())

list = []
for _ in range(n):
    list.append(input())

list.sort()
string = ""
for s in list:
    string += s

print("".join(string))

Solution (Python):
n, l = map(int, input().split())

list = []
for _ in range(n):
    list.append(input())

list.sort()
str = ""
for s in list:
    str += s

print(str)

Solution (Python):
n,l=map(int,input().split())
s=sorted([input() for _ in range(n)])
print(''.join(s))

Solution (Python):
N, L = map(int, input().split())
list = []
for _ in range(N):
    list.append(input())

list.sort()
string = ""
for l in list:
    string += l

print(string)

Solution (Python):
row = input().split()
N = int(row[0])
L = int(row[1])
row2 = [input().split() for i in range(N)]
s = []
for i in range(N):
    s.append(row2[i][0])
s.sort()
ans = "".join(s)
print(ans)

Solution (Python):
a = list(map(int,input().split()))
b = [input() for i in range(a[0])]
c = sorted(b)
print("".join(c))

Solution (Python):
from sys import stdin
N, L = map(int,input().split())
S = sorted([s for s in stdin.read().splitlines()])
print("".join(S))

Solution (Python):
N , L= map(int,input().split())
lst = []
for i in range(N):
    lst.append(input())
lst.sort()
Str = ''
for j in range(N):
    Str += lst[j]
print(Str)

Solution (Python):
N,L=map(int, input().split())
S=[]
for i in range(N):
    S.append(input())
S.sort()
result=''
for j in range(N):
    result+=S[j]     
print(result)

Solution (Python):
N, L = list(map(int, input().split()))
S = [0]*N
for i in range(N):
    S[i] = input()

S.sort()
ans = ''.join(S)
print(ans)

Solution (Python):
n,l=map(int,input().split())
t=sorted([input() for i in range(n)])
print(*t,sep="")

Solution (Python):
n, l = map(int, input().split())
s = [input().rstrip() for _ in range(n)]
s.sort()
print(''.join(s))

Solution (Python):
N, L = map(int, input().split())
print("".join(sorted((input() for _ in range(N)))))

Solution (Python):
N,L = map(int,input().split())
Strings = list()
for i in range(N):
    Strings.append(input())

ansString=""
for i in range(len(Strings)):
    for j in range(len(Strings)-1,i,-1):
        if Strings[j] < Strings[j-1]:
            Strings[j], Strings[j-1] = Strings[j-1], Strings[j]
            
for k in Strings:
    ansString += k
    
print(ansString)

Solution (Python):
n,l=map(int,input().split())
sl=[input() for _ in range(n)]
sl=sorted(sl)
print(''.join(sl))

Solution (Python):
N, L = map(int, input().split())
S = [input() for i in range(N)]
S.sort()
print(''.join(S))

Solution (Python):
N,L=map(int, input().split())
S=[]
for i in range(N):
  S.append(input())
S.sort()
result=''
for j in range(N):
  result+=S[j]

print(result)

Solution (Python):
N, L = list(map(int, input().split(' ')))


S = []
for i in range(N):
    S.append(list(input()))

S.sort()


for word in S:
    for char in word:
        print(char, end='')
print()

Solution (Python):
N, L = map(int, input().split())
s = []
for i in range(N):
	s += [input()]

s.sort()
for i in range(N):
	print(s[i], end="")

Solution (Python):
N, L = map(int, input().split())
S = list(input() for i in range(N))
S.sort()
str = ""
for i in S:
    str += i
print(str)

Solution (Python):
N, L = map(int, input().split())
S = list(input() for i in range(N))
str = ""
for i in range(N-1):
    for j in range(N-1):
        if S[j+1] + S[j] <= S[j] + S[j+1]:
            S[j], S[j+1] = S[j+1], S[j]
for i in S:
    str += i
print(str)

Solution (Python):
N, L = map(int, input().split())
S = sorted([input() for i in range(N)])
print(''.join(S))

Solution (Python):



N, L = map(int, input().split())
arr = [input() for i in range(N)]
sort_arr = sorted(arr)
for i in range(len(sort_arr)):
    print(sort_arr[i], end = "")

Solution (Python):
def main():
    n, l = map(int, input().split())
    words = [input() for i in range(n)]
    

    
    

    words.sort()
    print(''.join(words))

if __name__ == "__main__":

    main()

Solution (Python):
def main():
    n, l = map(int, input().split())
    words = []

    for i in range(n):
        words.append(input())

    words.sort()
    print(''.join(words))

if __name__ == "__main__":

    main()

Solution (Python):
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
print("".join(S))

Solution (Python):
N, L = map(int, input().split())
S    = sorted([input() for i in range(N)])

print(''.join(S))

Solution (Python):
N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(input())

S.sort()
print("".join(S))

Solution (Python):
n,l = map(int,input().split())
s = ["" for i in range(n)]

for i in range(n):
    s[i] = input()

s.sort()

a =""

for i in s:
    a += i
    
print(a)

Solution (Python):
N,L = map(int,input().split())

S = [input() for i in range(N)]

S = sorted(S)
str = ''
for i in range(N):
    str += S[i] 
print(str)

Solution (Python):
n, l = map(int, input().split())

words = [""] * n

for i in range(n):
  words[i] = input()

words.sort()

print("".join(words))

Solution (Python):
n,l = list(map(int, input().split()))
s = []
for i in range(n):
	s.append(input())
s.sort()

print("".join(s))

Solution (Python):
n, l = [int(x) for x in input().split()]
s = [0] * n
for i in range(n):
    s[i] = input()
s.sort()
print(''.join(s))

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, L = nl()
Ss = []
for i in range(N):
    Ss.append(s())
print(''.join(sorted(Ss)))

Solution (Python):
p=input().rstrip().split(' ')
l=[]
for i in range(0,int(p[0])):
    s=input().rstrip()
    l.append(s)
l.sort()
print(''.join(l))

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) 

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())

N,L = LI()
S = [0 for i in range(N)]
for i in range(N):
    S[i] = str(input())

S.sort()
print("".join(S))

Solution (Python):
def abc():
    n, l = map(int, input().split())
    s = []
    for i in range(n):
        s.append(input().rstrip())
    s.sort()
    print(''.join(s))


abc()

Solution (Python):
n, l = map(int, input().strip().split())
s_list = [input() for _ in range(n)]
s_list.sort()
 
for s in s_list:
    print(s, end='')
print()

Solution (Python):
n, l = map(int, input().split())
s_list = [input() for _ in range(n)]
s_list.sort()

for s in s_list:
    print(s, end='')
print()

Solution (Python):
N, L=map(int, input().split())
lst = []
ans = ""
for i in range(N):
    lst.append(input())
lst.sort()

for i in range(len(lst)):
    ans += lst[i]
    
print(ans)

Solution (Python):
N, L = list(map(int, input().split()))
S = []
for i in range(N):
    S.append(input())

S.sort()

S2 = ""

for item in S:
    S2 += item

print(S2)

Solution (Python):
N, L = map(int, input().split())
S_list = list(input() for i in range(N))

S_list.sort()
print(''.join(S_list))

Solution (Python):
N, L = map(int, input().split())
S_list = list(input() for i in range(N))

S_list.sort()

ans = ''
for s in S_list:
    ans += s
print(ans)

Solution (Python):

n, l=map(int,input().split())
s = sorted([input() for i in range(n)])
print(*s,sep="")

Solution (Python):
n,l=map(int,input().split())
words=[]
for i in range(n):
  words.append(input())
for i in range(l-1,-1,-1):
  words.sort(key=lambda x:ord(x[i]))
ans=""
for i in range(n):
  ans+=words[i]
print(ans)

Solution (Python):
N, L = map(int, input().split())
S = sorted([input() for _ in range(N)])
print(''.join(S))

Solution (Python):
N,L = map(int, input().split())
S = [input() for _ in range(N)]
S = sorted(S)
string = ''

for i in range(N):
    string += S[i]

print(string)

Solution (Python):
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print(''.join(s))

Solution (Python):
n, l = map(int , input().split())
s = sorted([input() for i in range(n)])
print(''.join(s))

Solution (Python):
N,L = [int(i) for i in input().split()]
S = [input() for _ in range(N)]

S.sort()
ans = ''

for i in S:
    ans += i
print(ans)

Solution (Python):
[n,l]=[int(_) for _ in input().split()]
s=[]
for i in range(n):
  s.append(input())
s.sort()
print(''.join(s))

Solution (Python):
n, l = map(int, input().split())
strings = [input() for _ in range(n)]
strings.sort()
s = ''
for i in range(n):
  s += strings[i]
print(s)

Solution (Python):
n, l = map(int, input().split())
s = []

for i in range(n):
  s.append(input())

s.sort()
ans = ""

for word in s:
  ans += word

print(ans)