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 = list(input() for _ in range(N))

for i in sorted(S):
    print(i,end="")

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

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

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

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())


N, L = mi()
print(''.join(sorted([input() for _ in range(N)])))

Solution (Python):
N, L = map(int, input().split())
words = []
for i in range(0, N):
	words.append(input())
words.sort()
ans = ''
for i in range(0, N):
	ans = ans + words[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());print(''.join(sorted([input() for i in range(N)])))

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

lst.sort()
ans = ""
for i in lst:
    ans += i
print(ans)

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

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

Solution (Python):

N,L = map(int,input().split())
S = [input() for _ in range(N)]
S.sort()
answer = ''.join(S)
print(answer)

Solution (Python):
n,l=map(int,input().split(" "))
word=[]
for i in range(n):
    w =input()
    word.append(w)
word_sorted = sorted(word)
for i in word_sorted:
    print(i,end='')

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

Solution (Python):


n, l = map(int, input().split())

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

s.sort()

for i in range(n):
    print(s[i], sep='', end='')

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

S.sort()

ans = ""
for s in S:
    ans+=s

print(ans)

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())
li = []

for _ in range(n):
  li.append(input())

sortedli = sorted(li)

ans = ''

for s in sortedli:
  ans += s

print(ans)

Solution (Python):

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

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

print("".join(sorted(strs)))

Solution (Python):
nk = list(map(int,input().split(' ')))
doc = []
for i in range(0,nk[0]):
  
  doc.append(input())

doc.sort()  
print(''.join(doc))

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

Solution (Python):
def main():
    n,l=map(int,input().split(' '))
    l_list=[]
    for i in range(n):
        l_list.append(input())
    sorted_l = sorted(l_list)
    for i in sorted_l:
        print(i,end='')

if __name__=='__main__':
    main()

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

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

arr = list()
for i in range(0, n):
    arr.append(input())
arr.sort()

for str in arr:
    print(str, end="")
print()

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

print(''.join(sorted(word, reverse=False)))

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 = []
for i in range(N):
  s_i = input().strip()
  S.append(s_i)
S = sorted(S)
print("".join([x for x in S]))

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=[input() for _ in range(N)]
S.sort()
answer=""
for i in range(N):
    answer+=S[i]
print(answer)

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

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

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 = [''.join([i for i in input().split()]) for i in range(N)]
print(''.join(sorted(S)))

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

Solution (Python):
int = list(map(int, input().split()))
li = [input() for i in range(int[0])]
li = sorted(li)
for i in range(int[0]):
    print(li[i], end="")

Solution (Python):
from functools import reduce


n, l = map(lambda x: int(x), input().split(' '))
s = []
for i in range(n):
    s.append(input())

def concat_str(a, b):
    return a + b

s.sort()
print(reduce(concat_str, s))

Solution (Python):
a,b=map(int,input().split())

List=[]
for i in range(a):
    List.append(input())

print("".join(sorted(List)))

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

word=[]
for i in range(l):
    word.append(input())
    
sw=sorted(word)
print("".join(sw))

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())
text = []
for i in range(N):
    text.append(input())
text.sort()
ans = "".join(text)
print(ans)

Solution (Python):
N,L = list(map(int, input().split()))
list = []
for n in  range(N):
    list.append(input())
list.sort()
literal = ""
for n in  range(N):
    literal +=list[n]
print(literal)

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

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

list = sorted([input() for i in range(n)])
print("".join(list))

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

S.sort()

for n in range(1,N):
    S[0] = S[0]+S[n]

print(S[0])

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

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

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

print("".join(sorted(s_list)))

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

dic=[]

for i in range(n):
    x=input()
    dic.append(x)

print("".join(sorted(dic)))

Solution (Python):
N,L = list(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 = sorted([input() for i in range(n)])
print(*s,sep="")

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

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

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, L = list(map(int, input().split()))
S = [input() for n in range(N)]
S.sort()
print(''.join(S))

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

Solution (Python):
def resolve():
    N, L = map(int, input().split(' '))
    
    S = []
    
    for x in range(0, N):
        S.append(input())
        
    S.sort()
    
    [ print(S , end='') for S in S]

if __name__ == '__main__':
    resolve()

Solution (Python):
H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())
sor =S.sort()
ans = ''.join(S)
print(ans)

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

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

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 = [input() for i in range(N)]

sort_S = sorted(S)

for s in sort_S:
  print(s, end ="")

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())
Ss = []
for i in range(N):
    S = input()
    Ss.append(S)
Ss = sorted(Ss)
ans = ""
for S in Ss:
    ans += S

print(ans)

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

Solution (Python):
number,length = map(int,input().split())
string = [input() for i in range(number)]
string.sort()
for i in range(number):
    print(string[i] , end = "")

Solution (Python):
N,L = map(int,input().split())
S = []
for x 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))
S.sort()
for str in S:
        print(str,end="")
print()

Solution (Python):
N, L = map(int, input().split())
S = []
for i in range(N):
  S.append(str(input()))
S.sort()
ans = ''
for s in S:
  ans += s
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="")

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

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

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

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

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

print(''.join(ss))

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

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

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

Solution (Python):
a,b=map(int,input().split())
List=[input() for i in range(a)]

print("".join(sorted(List)))

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

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

Solution (Python):
def f(n, l):
  ss = [input() for i in range(n)]
  ss.sort()
  return ''.join(ss)
  
if __name__ == '__main__':
  nl = [int(n) for n in input().split(' ')]
  n = nl[0]
  l = nl[1]
  print(f(n, l))

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

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())


input_list = []
for i in range(n) :
    a = input()
    input_list.append(a)
    

input_list.sort(reverse=False)
print("".join(input_list))

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

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

sorted_S = sorted(S)

ans=''

for s in sorted_S:
    ans += s

print(ans)

Solution (Python):
n=int(input().split()[0])
S=sorted(input() for _ in [0]*n)
print("".join(S))

Solution (Python):
N,L=map(int,input().split())
dic={}
data=[]

for _ in range(N):
    word=input()
    data.append(word)

data=sorted(data)
ans=''
for d in data:
    ans+=d




















print(ans)

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

for _ in range(N):
    word=input()
    if not word in dic:
        dic[word]=1
    else:
        dic[word]+=1

ans=''

dic=sorted(dic.items())

for k,v in dic:
    for _ in range(v):
        ans+=k

print(ans)

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

Solution (Python):

n,l=map(int,input().split(" "))

alist=[]

for _ in range(n):
  alist.append(input())

alist.sort()

alist2="".join(alist)
print(alist2)

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

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

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

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

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

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

print(''.join(sorted(words)))

Solution (Python):
import itertools

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

print(''.join(sorted(s)))

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

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())
list1 = []

for i in range(n):
    list1.append(input())
    
list1.sort()

print("".join(list1))

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()
ans = ""
for k in range(N):
    ans += S[k]
print(ans)

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

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 = list()
for i in range(n):
  s.append(input())

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

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

k=[]

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

x=sorted(k)
z="".join(x)

print(z)

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

Solution (Python):
def min_join(strings):
    """文字を全て結合して、辞書順で最も小さくなる文字を探す。"""
    strings.sort()
    return ''.join(strings)


def main():
    N, L = (int(i) for i in input().split())
    strings = [input() for _ in range(N)]
    print(min_join(strings))
    

main()

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

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

WORDS.sort(key=str,reverse=False)



for i in range(N):
    print(WORDS[i],end="")

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

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, 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 = sorted(S)

print(''.join(S))

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=[input() for _ in range(n)]
s.sort()
print(''.join(s))

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

Solution (Python):

N, L = map(int, input().split())
a = [input() for i in range(N)]
a.sort()
b = "".join(a)
print(b)

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

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 = [input() for _ in range(N)]
S.sort()
print(''.join(S))

Solution (Python):
N,L = map(int,input().split())
str_list = []
for _ in range(N):
    str_list.append(input())
str_list = sorted(str_list)
ans = ""
for string in str_list:
    ans += string
print(ans)

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

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

Solution (Python):

n, l = list(map(int, input().rstrip().split()))
lst = sorted([input().rstrip() for _ in range(n)])
for i in lst:
    print(i, end="")

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

english.sort()
S=''
for i in range(N):
    S=S+english[i]

print(S)

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

Solution (Python):
def main():
	N, L = map(int, input().split())
	S = list()
	for _ in range(N):
		s = input()
		S.append(s)
	S.sort()
	ans = "".join(S)
	print(ans)


if __name__ == '__main__':
	main()

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

print(ans)

Solution (Python):
def task_b():
    """
    https://atcoder.jp/contests/abc042/tasks/abc042_b
    """
    n, _ = map(int, input().split())
    sss = [input().strip() for _ in range(n)]
    
    sss.sort()
    print(''.join(sss))


task_b()

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

S.sort()
ans = ""
for x in S:
    ans += x

print(ans)

Solution (Python):


n, l = map(int, input().split())

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

print(''.join(strings))

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 = []
master = 'abcdefghijklmnopqrstuvwxyz'

def f(s1, s2, l):
    for i in range(l):
        if master.index(s1[i]) == master.index(s2[i]):
            continue
        elif master.index(s1[i]) > master.index(s2[i]):
            return 'greater'
        elif master.index(s1[i]) < master.index(s2[i]):
            return 'less'
    return 'equal'

for _ in range(N):
    if _ == 0:
        S.append(input())
    else:
        s = input()
        max_iter = len(S)
        for i in range(max_iter):
            compared = f(s, S[i], L)
            if compared == 'greater' and i == max_iter-1:
                S.append(s)
                break
            elif compared == 'less':
                S.insert(i, s)
                break
            elif compared == 'equal':
                S.insert(i, s)
                break
            else:
                continue

print(''.join(S))

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

Solution (Python):


N,L = map(int, input().split())
Ln = []
for _ in range(N):
  Ln.append(str(input()))
Ln = sorted(Ln)
print(*Ln,sep="")

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

Solution (Python):
import sys
from collections import Counter

n, l = map(int, input().split())
s_list = sorted([input() for _ in range(n)])

print(''.join(s_list))

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

new_S = "".join(S)
print(new_S)

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

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

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 = [input() for i in range(N)]
S.sort()
ans = ""
for s in S:
    ans += s
print(ans)

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

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

S.sort()
ans = ''
for i in S:
    ans += i

print(ans)

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

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

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 _ in range(N)]
S.sort()
print("".join(S))

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

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

Ss = sorted(Ss)
print(''.join(Ss))

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

Solution (Python):
cnt,l = map(int,input().split())
list1 = []
for x in range(cnt):
    list1.append(input())

list1.sort()
print(''.join(list1))

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

Solution (Python):

def read_input():
    n, l = map(int, input().split())

    slist = []
    for i in range(n):
        slist.append(input().strip())

    return n, l, slist

if __name__ == '__main__':
    n, l, slist = read_input()

    slist.sort()
    print(''.join(slist))

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

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

lists.sort()

s=""
for i in lists:
  s+=i
print(s)

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

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 = sorted([input() for _ in range(N)])

ans = ""
for s in S:
    ans += s

print(ans)

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

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

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

alphabet = []
for i in range (N):
    word = input()
    alphabet.append(word)
    
alphabet.sort()
print(''.join(alphabet))

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

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N, L = map(int, input().split())
    A = [input().strip() for _ in range(N)]
    A = sorted(A)

    return ''.join(A)


if __name__ == '__main__':
    print(main())

Solution (Python):
n,l=(int(x) for x in input().split())

mojil=[]

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

mojil.sort()

for i in range(n):
    print(mojil[i],end="")

Solution (Python):
N, L = list(map(int, input().split()))
s = [input() for i in range(N)]
s.sort()
ans = ''
for i in s:
    ans += i
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())
S = []
A = ""

for i in range(N):
    s = input()
    S.append(s)
S.sort()
for i in S:
    A += i
print(A)

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())
word = []
for i in range(n):
    s = input()
    word.append(s)
word.sort()
print(*word,sep="")

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

s.sort()
for i in s:
    ans += i

print(ans)

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

print(''.join(sorted(S)))

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

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

order=sorted(s)
ans=''.join(order)
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())
d=[input() for i in range(n)]
d.sort()
ans=""
for i in d: ans+=i
print(ans)

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

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

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

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 i in range(N):
    S.append(str(input()))

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

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

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

sorted_list = sorted(input_list)
comb_str = "".join(sorted_list)
print(comb_str)

Solution (Python):

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

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

f=sorted(s)
ans=''.join(f)
print(ans)

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

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

Solution (Python):

n, l = map(int, input().split())
a = []
for i in range(n):
    a.append(input())
a = sorted(a)
ans = ""
for i in range(n):
    ans += a[i]
print(ans)

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

strings.sort()
s=''
for i in strings:
    s += i

print(s)

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

Solution (Python):
from sys import stdin
input1=stdin.readline().rstrip().split()
N=int(input1[0])
L=int(input1[1])
input=[]
for n in range(N):
  input.append(stdin.readline().rstrip())

input.sort()
output=""
for i in range(len(input)):
  output+=input[i]

print(output)

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 = [input() for i in range(n)]
s = sorted(s)
print("".join(s))

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, 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()
print(''.join(map(str,s)))

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

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

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

new_list=sorted(m_list)


print("".join(new_list))

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())
a =[input() for _ in range(N)]
a.sort()
print ("".join(a))

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

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

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

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

s = []

for i in range(0, nl[0]):
    s.append(input())

s.sort()

print(''.join(s))

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

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

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

Solution (Python):

n, l = map(int, input().split())



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

test = ""
for line in lines:
    test += line

print(test)

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):
N, L = map(int, input().split())
S = [input().rstrip() for _ in range(N)]
print(''.join(sorted(S)))

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

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

Solution (Python):
a, b = map(int, input().split())
letters = []
for i in range(a):
    c = input()
    letters.append(c)
letterss = sorted(letters)
mojiretsu = ''
for x in letterss:
    mojiretsu += x
print (mojiretsu)

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

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

Solution (Python):


n,l=map(int,input().split())

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

s.sort()

print(*s,sep="")