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):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,l = inpl()
s = [input() for i in range(n)]
s.sort()
print(''.join(s))

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

Solution (Python):
def ans(s):
  s = sorted(s)
  s = ''.join(s)
  return s
    

if __name__ ==  "__main__":
    n, l = list(map(int, input().split()))
    s = ans([input() for i in range(n)])
    print(s)

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

Solution (Python):
a,b = (int(num) for num in input().split())
list = []

while a>0:
    word = input()
    list.append(word)
    a -= 1
    
list.sort()
joined = ''.join(list)
print(joined)

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

if __name__ == '__main__':
    main()

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

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

A.sort()
result = ''.join(A)
print(result)

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

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

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

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

Solution (Python):
a,b = (int(x) for x in input().split())
s=[]
c=''
for i in range(a):
    s.append(input())
s.sort()
for i in range(a):
    c+=s[i]

print(c)

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

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

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

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

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

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

print(result)

Solution (Python):
def exam2():
    N, L = LI()
    S =[None]*N
    for i in range(N):
        S[i] = str(input())
    S.sort()

    print("".join(map(str,S)))



import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

exam2()

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

result = "".join(sorted(S))
print(result)

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

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

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

Solution (Python):

import sys
input = sys.stdin.readline


N,L = map(int,input().split())
S = list(input().rstrip() for _ in range(N))

S.sort()

print("".join(S))

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 = map(int,input().split())
ls = sorted([input() for i in range(n)])
print(''.join(ls))

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

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

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

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

for i in range(N):
  str_list.append(str(input()))

str_list.sort()

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

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

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

Solution (Python):

N, L = map(int, input().split())
S = []
for _ in range(N):
    s = input()
    S.append(s)
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(S))

Solution (Python):
NL = input().split()

iroha = []
i=0
while i < int(NL[0]):
    inp = input()
    iroha.append(inp)
    i+=1

for value in sorted(iroha):
    print(value, end='')

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

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

Solution (Python):
n, l = map(int, input().split())
li = list()
for _ in range(n):
    li.append(input())

li.sort()
print(''.join(li))

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

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

strings.sort()
print(''.join(strings))

Solution (Python):

line = input().split()
M=str(line[0])
N = int(line[0])
L = line[1]
S = []

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

answer="".join(Sorted_S)
print(answer)

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

S.sort()
for word in S:
    print(word, end="")
print()

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

Solution (Python):
N, M = map(int, input().split())
strings = [input() for i in range(N)]
result = ''
for _ in range(N):
    index = strings.index(min(strings))
    result += strings[index]
    strings.pop(index)

print(result)

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

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

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

li = sorted(li)
ans = ""
for i in range(n):
  ans += li[i]
print(ans)

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

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

s.sort()

ans =''.join(s)

print(ans)

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

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

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

Solution (Python):



num,len = map(int, input().split())

str = list(input() for i in range(num))
last_str = ""

str.sort() 

for s in str:
  last_str = last_str + s
print(last_str)

Solution (Python):
n,l = map(int,input().split())
S = sorted([input() for _ in range(n)])
print(*S,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=[]
for i in range(0,n):
    s.append(input())
s.sort()
ans=""
for str in s:
    ans += str

print(ans)

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

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())
p=[]
for i in range(n):
    p.append(str(input()))
p.sort()
print(''.join(map(str,p)))

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(" "))
words=[input() for i in range(0,n)]
words.sort()
words="".join(words)
print(words)

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

S.sort()

result = ''.join(S)

print(result)

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 = []
for s in range(N):
    s = input()
    S_list.append(s)

S_list.sort()
combined_S = ''
for i in range(N):
    combined_S += S_list[i]

print(combined_S)

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

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

Solution (Python):


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


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

LL.sort()
print("".join(LL))

Solution (Python):
n,l = list(map(int,input().split()))
ans = []
for _ in range(n):
    a = input()
    ans.append(a)
    ans = sorted(ans)
print("".join(i for i in 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 = map(int, input().split())
s_li = list()
for _ in range(n):
    s_li.append(input())

s_li.sort()
print(''.join(s_li))

Solution (Python):
N, L=list(map(int,input().split()))
s=[]
ans=''
for i in range(N):
    s.append(input())
for i in range(N-1):
    for j in range(N-i-1):
        s1=s[i]
        s2=s[i+j+1] 
        k=0
        while k < L-1 and ord(s1[k])==ord(s2[k]): 
            k+=1
        if ord(s1[k]) > ord(s2[k]):
            s[i]=s2
            s[i+j+1]=s1
    ans+=s[i]
ans+=s[N-1]
print(ans)

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

Solution (Python):
arr_len_int = int(input().split(' ')[0])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))

Solution (Python):


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

s.sort()
print("".join(s))

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

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

ans = ''.join(words)
print(ans)

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

Solution (Python):
size, length = map(int, input().split())
strList = []
for counter in range(size):
  strList.append(input())
strList.sort()
print(''.join(strList))

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 = input().split(" ")
strings = []
ans = ""
for i in range(int(N_L[0])):
    S = input()
    strings.append(S)
strings.sort()
for j in strings:
    ans = ans + j
print(ans)

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

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

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

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

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

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


if __name__ == '__main__':
    lovestrings()

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

Solution (Python):
n = list(map(int, input().split()))
N = n[0]
L = n[1]

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

s.sort()
ss = "".join(s)
print(ss)

Solution (Python):

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

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

S.sort()

print("".join(S))

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

Solution (Python):
from sys import exit, stdin
N, L = [int(_) for _ in stdin.readline().rstrip().split()]
print(''.join(sorted([stdin.readline().rstrip() for _ in range(N)])))

Solution (Python):
hoge,fuga=map(int,input().split())
data=sorted([input() for i in range(hoge)])
print("".join(data))

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(input())
s.sort()
ans = ''
for j in s:
  ans += j
print(ans)

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

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

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

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

s = []

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

s.sort()

print(*s, sep='')

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

Solution (Python):
import sys
input = sys.stdin.readline


def main():
    N, L = map(int, input().split())
    S = []
    for _ in range(N):
        S.append(input().strip())
    S.sort()
    ans = ""
    for s in S:
        ans += s
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n,m=map(int,input().split())
mat=[]
for i in range(n):
    mat.append(input())
mat.sort(key=lambda x:x)
ans=''
for i in mat:
    ans+=i 
print(ans)

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

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

s = ""
for word in ln:
  s += word
  
print(s)

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

Solution (Python):

count, length = list(map(int, input().split()))

words = []
for i in range(count):
  s = input()
  if len(s) != length:
    continue
  words.append(s)

words = sorted(words)

r = ''.join(words)
print(r)

Solution (Python):
print("".join(sorted([input() for i in range(int("{}".format(input().split().pop(0))))])))

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 = sorted(map(str,[input() for i in range(n)]),reverse = False)
sstr = ','.join(s).replace(",","")
print(sstr)

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

ans = ""
for i in range(int(N)):
        ans += newS[i]

print(ans)

Solution (Python):

def main():
    _, _, *A = open(0).read().split()
    A.sort()
    print("".join(A))


if __name__ == "__main__":
    main()

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

print("".join(S))

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

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

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 = []
res = []

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

s.sort()

for i in range(n):
  res.append(s.pop(0))

result = ''.join(res)
print(result)

Solution (Python):
n, l = map(int, input().split())
count = 0
s = []
while count < n:
    s.append(input())
    count += 1
print(''.join(sorted(s)))

Solution (Python):
N, L = list(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())
List = [input() for i in range(N)]

List.sort()

for i in range(N):
  print(List[i], end = '')

Solution (Python):
N, L = list(map(int, input().split()))
letters = []
nums = []
for i in range(N):
    n = []
    for j in range(L):
        n.append(0)
    nums.append(n)


for i in range(N):
    S = []
    s = input()
    for j in range(L):
        S.append(s[j])
    letters.append(S)

def letter(let):
    if let == "a":
        nums[i][j] = 1
    elif let == "b":
        nums[i][j] = 2
    elif let == "c":
        nums[i][j] = 3
    elif let == "d":
        nums[i][j] = 4
    elif let == "e":
        nums[i][j] = 5
    elif let == "f":
        nums[i][j] = 6
    elif let == "g":
        nums[i][j] = 7
    elif let == "h":
        nums[i][j] = 8
    elif let == "i":
        nums[i][j] = 9
    elif let == "j":
        nums[i][j] = 10
    elif let == "k":
        nums[i][j] = 11
    elif let == "l":
        nums[i][j] = 12
    elif let == "m":
        nums[i][j] = 13
    elif let == "n":
        nums[i][j] = 14
    elif let == "o":
        nums[i][j] = 15
    elif let == "p":
        nums[i][j] = 16
    elif let == "q":
        nums[i][j] = 17
    elif let == "r":
        nums[i][j] = 18
    elif let == "s":
        nums[i][j] = 19
    elif let == "t":
        nums[i][j] = 20
    elif let == "u":
        nums[i][j] = 21
    elif let == "v":
        nums[i][j] = 22
    elif let == "w":
        nums[i][j] = 23
    elif let == "x":
        nums[i][j] = 24
    elif let == "y":
        nums[i][j] = 25
    elif let == "z":
        nums[i][j] = 26

for i in range(N):
    for j in range(L):
        letter(letters[i][j])

letters = sorted(letters)

ans = ""

for i in range(N):
    for j in range(L):
       ans += letters[i][j]

print(ans)

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

ans = []

for _ in range(n):
    s = input()
    inserted = False
    for i, s2 in enumerate(ans):
        if s < s2:
            ans.insert(i, s)
            inserted = True
            break
    if not inserted:
        ans.append(s)

print(''.join(ans))

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):
    s.append(input())
s.sort()
print("".join(s))

Solution (Python):



import pdb
import sys
F = sys.stdin
N, L = F.readline().rstrip().split()
N = int(N)
L = int(L)
a = [F.readline().rstrip() for x in range(N)]

a.sort()
answer = ''.join(a)
print(answer)

Solution (Python):


if __name__ == "__main__":
    n, l = map(int, input().split())
    words = []
    for i in range(n):
        words.append(input())
    words.sort()
    print("".join(words))

Solution (Python):
C = list(map(int,input().split()))
n = C[0]
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())

out = []
min_ = float("inf")
min_idxs = list(range(len(S)))
pos = 0
while S:
    new_min = []
    for i in min_idxs:
        s = S[i]
        ch = ord(s[pos])
        if ch < min_:
            min_ = ord(s[pos])
            new_min = [ i ]
        elif ch == min_:
            new_min.append(i)
    if len(new_min) == 1 or pos == l - 1:
        for i in range(len(new_min)):
            out.append(S[new_min[i]])
        for i in range(len(new_min) - 1, -1, -1):
            del S[new_min[i]]
        min_idxs = list(range(len(S)))
        pos = 0
    else:
        pos += 1
        min_idxs = new_min
    min_ = float("inf")

r = "".join(out)
print(r)

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

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

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

a = sorted(string_list)

print(''.join(a))

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

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

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

Solution (Python):

class Heap:
    def __init__(self,nodes):
        self.nodes = nodes

    def buildHeap(self):
        for i in range(int(len(self.nodes)/2),-1,-1):
            self.siftDown(i)

    def siftDown(self,start):
        while (2*start+1 < len(self.nodes)):
            c = 2*start+1
            if (c+1 < len(self.nodes) and self.nodes[c+1] < self.nodes[c]):
                c += 1
            if (self.nodes[c] < self.nodes[start]):
                self.nodes[start], self.nodes[c] = self.nodes[c], self.nodes[start]
                start = c
            else:
                return

    def getMin(self):
        min = self.nodes[0]
        self.nodes[0] = self.nodes[-1]
        del(self.nodes[-1])
        self.siftDown(0)
        return min


nStr, strLen = map(int,input().split())
nodes = []
for i in range(nStr):
    nodes.append(input())

heap = Heap(nodes)
heap.buildHeap()

minStr = ''
for i in range(nStr):
    minStr += heap.getMin()

print(minStr)

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

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

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

print(*sorted(S), sep='')

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

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

Solution (Python):
s = input().rstrip().split(' ')
num = int(s[0])
list = []
for i in range(num):
	list.append(str(input()))
list.sort()
string = "".join(list)
print(string)

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

wordlist.sort()

word=""
for i in range(N):
  word+=wordlist[i]

print(word)

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

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 i in range(n)])
print(*s,sep='')

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

Solution (Python):
def check(strings):
    return ''.join(sorted(strings))


def main():
    n, l = map(int, input().split())
    strings = []
    for i in range(n):
        strings.append(input())
    print(check(strings=strings))


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, l = list(map(int, input().rstrip('\n').split()))
    s = [str(input().rstrip('\n')) for _ in range(n)]
    s.sort()
    print("".join(s))


if __name__ == '__main__':
    slove()

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

Solution (Python):
import sys

input = sys.stdin.readline
N, L = map(int, input().split())
s_list = []
for s in range(N):
    s_list.append(input().rstrip())

s_list = sorted(s_list)

line = ''
for s in s_list:
    line += s
print(line)

Solution (Python):
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())
s.sort()
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, 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()
print(''.join(s))

Solution (Python):

str_num, str_len = map(int, input().split())
strs = list(str(input()) for s in range(str_num))
strs.sort()
ans = "".join(strs)
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 = []
for _ in range(n):
  s.append(input())
s = sorted(s)
print(*s, sep="")

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

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

print(*sorted_list, sep = '')

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

list=[]
for i in range(N):
    string = input()
    list.append(string)
    
new_list = sorted(list)

st="".join(new_list)
print(st)

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

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

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

ans=sorted(string_list)

print(''.join(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 = map(int, input().split())
print("".join(sorted([input() for _ in range(n)])))

Solution (Python):
def _input():
    array = input().split()
    return int(array[0])

def input_str(number):
    array = []
    for i in range(number):
        array.append(input())
    return array

def answer(array):
    return ''.join(sorted(array))
    
if __name__ == "__main__":
    n = _input()
    array = input_str(n)
    print(answer(array))

Solution (Python):
n, l = map(int, input().split())
temp_list = []
for i in range(n):
  temp_list.append(input())
ans_list = []
for temp_str in temp_list:
  if len(ans_list) == 0:
    ans_list.append(temp_str)
  else:
    max_flg = True
    for i in range(len(ans_list)):
      if temp_str <= ans_list[i]:
        ans_list.insert(i, temp_str)
        max_flg = False
        break
    if max_flg == True:
      ans_list.append(temp_str)
ans = ''.join(ans_list)
print(ans)

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

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

Solution (Python):
n,l = map(int, input().split())
list = sorted([input() for i in range(n)])
print(*list, 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 = [input() for i in range(N)]
S_sort = sorted(S)
print("".join(S_sort))

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