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











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,L=MI()
    S=[ST() for _ in range(N)]
    S.sort()
    print(*S,sep="")
if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N, L = (int(i) for i in input().split())
    A = [input() for i in range(N)]
    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())
lst = [input() for _ in range(N)]
lst.sort()
print(''.join(lst))

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

Solution (Python):
n, l = list(map(int, input().rstrip().split()))
s = []
for _ in range(n):
    s += [input()]
s.sort()
ans = str()
for x in s:
    ans += x
print(ans)

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

sl.sort()
ans = ""
for s in sl:
    ans += s

print(ans)

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

S = []
for s in range(0, N):
    S.append(input())
S.sort()

print(''.join(S))

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

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

for word in words:
  print(word,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())

sl = [input() for i in range(n)]
sl.sort()
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 = [input() for _ in range(N)]

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

Solution (Python):
try:
  N, L = map(int, input().split())
  l = []
  for i in range(N):
      l.append(input())
  l_ = sorted(l)
  print(''.join(l_))
except EOFError:
  pass

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

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

S1 = sorted(S)

S2 ="".join(S1)

print(S2)

Solution (Python):

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

list_A.sort()
ans = "".join(list_A)
print(ans)

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

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

s_lst.sort()

print(''.join(s_lst))

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

S_sorted = sorted(S, reverse=False)
print("".join(S_sorted))

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

Solution (Python):
def hikaku(n1, n2):
    for x, y in zip(n1, n2):
        if ord(x) == ord(y):
            continue
        else:
            return True if ord(x) > ord(y) else False
num, length = map(int, input().split())
wlist = []
for i in range(num):
    wlist.append(input())
for n in range(num - 1):
    kumi = [(x, x+1) for x in range(num - 1 - n)]
    if kumi:
        for x, y in kumi:
            if hikaku(wlist[x], wlist[y]):
                wlist[x], wlist[y] = wlist[y], wlist[x]
dst = ""
for w in wlist:
    dst += w
print(dst)

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

Solution (Python):

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

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

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

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

Solution (Python):




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


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):

num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
print(''.join(sorted(data)))

Solution (Python):
N,L=map(int,input().split())
S=[input() for n in range(N)]
S=sorted(S)
"""for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
                break
"""
print("".join(S))

Solution (Python):
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
import itertools

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, L = map(int, readline().split())
S = read().decode('utf8').split()

S.sort()

print(*S,sep='')

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

words = []

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

print("".join(sorted(words)))

Solution (Python):
n, l = map(int, input().split())
list = []
for x in range(n):
    list.append(input())
else: list.sort()
answer = ""
for id in range(n):
    answer += list[id]
print(answer)

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

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

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

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

Solution (Python):


N,L = map(int, input().split())
s = [input() for _ in range(N)]
t = sorted(s)
print(''.join(t))

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

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

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

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

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

Solution (Python):

s=input()
m=s.split()
n=int(m[0]);
l=int(m[1]);

list=[]
for i in range(n):
    st=input()
    list.append(st)
list.sort()
for i in list:
    print(i,end="")

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

s = []

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

s.sort()

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

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

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

Solution (Python):


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

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

S.sort()

str = ''.join(S)

print(str)

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

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

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

ans = sorted(S)

print(''.join(ans))

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

Solution (Python):
import math


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



a = [""]*n
for i in range(n):
  a[i] = str(input())


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

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

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

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

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

sss.sort()

print("".join(sss))

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

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

Solution (Python):
import sys
import numpy as np

lines = sys.stdin.readlines()
lines = np.array(lines[1:]).flatten()
lines = [ l.replace("\n", "") for l in lines ]
lines = np.sort(lines)

s = ""
for l in lines:
  s += l
print(s)

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

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

Solution (Python):
in_len = input().split(" ")
in_n = int(in_len[0])
in_l = int(in_len[1])
in_s = []

for i in range(in_n):
  in_s.append(input())

srt = sorted(in_s)
print("".join(srt))

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

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

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

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

list.sort()
print("".join(list))

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

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

Solution (Python):
def getInput():
    return [i for i in input().rstrip().split(' ')]

N, L = map(int, getInput());
lst = []
for i in range(N):
    lst.append(getInput()[0])

lst.sort()
print(''.join(lst))

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

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

Solution (Python):
import sys


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())
list = []
for i in range(N):
    list.append(input())
list.sort()
for j in range(N):
    print(list[j], end='')

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

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
def S_():
    return input()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
YN=['Yes','No']
inf=float('inf')
input=lambda: sys.stdin.readline().rstrip()

ans=1

a=[]
n,l=LI()
for i in ' '*n:
    a.append(input())

print(''.join(sorted(a)))

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

Solution (Python):
N,K = map(int, input().split())
lst = []
for z in range(N):
    lst.append(input())
lst.sort()
print("".join(lst))

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(*s, sep='')

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

lo = ""
for i in li:
    lo += i
    
print(lo)

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

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

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

res = ''
for c in sorted(chars):
	res += c
    
print(res)

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

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

for i, a in enumerate(Ss):
  key = a
  j = i - 1

  while j >= 0 and Ss[j] > a:
    Ss[j + 1] = Ss[j]
    j = j - 1

  Ss[j + 1] = key

print(''.join(Ss))

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

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

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

Solution (Python):
def order_sentence(args_num, arg_sentence_length, args_list):
    ordered_sentence = "".join(sorted(args_list))
    return ordered_sentence

if __name__=='__main__':
    args_num, arg_sentence_length = map(int, input().split())
    args_list = [input() for i in range(args_num)]
    print(order_sentence(args_num, arg_sentence_length, args_list))

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

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

s.sort()
print(''.join(s))

Solution (Python):
if __name__ == '__main__':
	Ss = []
	N, L = map(int, input().split())
	for i in range(0,N):
		Ss.append(input())

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

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()
print(''.join(S))

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

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

L = sorted(S)

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

print(ans)

Solution (Python):
N, L = map(int, input().split())
strs = [[]] * N
for i in range(N):
  strs[i] = str(input())
strs.sort()
x = strs[0]
for j in range(1,N):
   x += strs[j]
print(x)

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

Solution (Python):
N, L = map(int, input().split())
Y = []
for i in range(N):
    S = str(input())
    Y.append(S)
Z = sorted(Y)
U = str()
for j in Z:
    U += j
print(U)

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

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

Solution (Python):

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

for i in range(N):
  S = str(input())
  S_list.append(S)
  
S_list.sort(reverse=False)


print(''.join(map(str,S_list)))

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

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

alist = []

for i in range(N):
    alist.append(input())
 
blist = []
blist = sorted(alist)
ans = "".join(blist)

print(ans)

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

s = [str(input()) for i in range(N)]
p = sorted(s)
print("".join(p))

Solution (Python):
arr = input().split()
n = int(arr[0])
l = int(arr[1])
s = []
for i in range(n):
    s.append(str(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 = [input() for _ in range(N)]

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

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

Solution (Python):
NL = input().split()
N = int(NL[0])
strList = []
for i in range(N):
    strList.append(input())
strList.sort()
strLong = ''
for i in range(N):
    strLong += strList[i]
print(strLong)

Solution (Python):
N, K = [int(x) for x in input().split()]
a = []
for _ in range(N):
  a.append(input())
a.sort()
print(''.join(a))

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

Solution (Python):
ss = []

n, l = list(map(int, input().split()))
for _ in range(n):
  ss.append(input())
  
ss.sort()

print("".join(ss))

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,l=INTM()
    s=[]
    for i in range(n):
        s.append(STR())
    s.sort()
    print(*s,sep='')
if __name__ == '__main__':
    do()

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

s.sort()
ret = ""
for i in range(int(n)):
    ret = ret + s[i]

print(ret)

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

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

Solution (Python):
import os

if __name__ == "__main__":
    temp = input().split(" ")
    N = int(temp[0])
    L = int(temp[1])
    S = [0]*N
    for i in range(0, N):
        S[i] = input()
    S.sort()
    print("".join(S))

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

S.sort()
s = []

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

print("".join(s))

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

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

chars = [input() for _ in range(N)]

print(''.join(sorted(chars)))

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

Solution (Python):


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

for _ in range(N):
    s = input()
    s_list.append(s)
ans = "".join(sorted(s_list))

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=list(input() for i in range(N))
S.sort()
print(*S,sep="")

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

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

ans = ""

s.sort()
for i in range(n):
    ans += s[i]
print(ans)

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

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

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

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

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

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

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

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

list = sorted(list)

print(''.join(list))

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

Solution (Python):
input_map = []
string_num, string_length = map(int, input().split())
for i in range(string_num):
    input_line = input()
    input_map.append(input_line)

input_map.sort()

line = ""
for i in range(string_num):
    line = line + input_map[i]

print(line)

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

Solution (Python):


n, l = map(int, input().split())
s = ["" for _ 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=[]
for i in range(N):
  s.append(input())
print(''.join(sorted(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 = sorted([str(input()) for _ in range(n)])
ans = ''
for i in s:
 ans += i  
print(ans)

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

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

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=[input() for i in range(n)]
S.sort()
print(*S,sep='')

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

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

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

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

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

li.sort()
print("".join(li))

Solution (Python):

n,k = map(int, input().split())
sl = [input() for _ in range(n)]

sl.sort()
print("".join(sl))

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

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

ans = ''
for s in sorted(S):
  ans += s

print(ans)

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

S = sorted(S)
ans = ''
for i in range(n):
    ans += S[i]
print(ans)

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

Solution (Python):
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())
for i in range(n - 1):
    for j in range(i + 1, n):
        if len(s[j]) < len(s[i]) and s[i] == s[j]:
            s[i], s[j] = s[j], s[i]
        else:
            for k in range(min(len(s[i]), len(s[j]))):
                if ord(s[i][k]) > ord(s[j][k]):
                    if s[i][:k] == s[j][:k]:
                        s[i], s[j] = s[j], s[i]
print(*s, sep="")

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

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


sASorted = sorted(sArray)

result = ''.join(sASorted)

print(result)

Solution (Python):
num = input().split()
str = [input()]
strc = ''
flg = 0
res = ''
for i in range(int(num[0])-1):

	strc = input()
	for j in range(len(str)):
		if str[j] < strc:

			flg = 0
		else:

			flg = j
			break
		j += 1
	flg = -1
	if flg == 0:
		str.append(strc)
	else:
		str.insert(j,strc)

for x in str:
	res += x
print(res)

Solution (Python):
import sys


def solve(inp):
    (N, L) = map(int, inp.readline().split(' '))
    S = sorted([inp.readline() for i in range(N)])

    r = ""
    for s in S:
        r += s.strip()

    return r


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline
N,L = [int(i) for i in input().split()]
nes = ['t'] * N
for i in range(N):
    nes[i] = input()
nes.sort()
S = ''.join(nes)
Sa = S.replace('\n','')
print(Sa)

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

s.sort()

d = ''
for i in range(n):
	d += s[i]

print(d)

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

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

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

print(*s, sep='')

Solution (Python):



def main():

    str_count, _ = map(int, input().split(' '))
    str_join = []

    for _ in range(str_count):
        str_join.append(input())
        
    str_join = sorted(str_join)    

    print(''.join(str_join))

    return 0


if __name__ == '__main__':
    main()

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

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

value = ""
for i in range(N):
    for j in range(i+1,N):
        if S[i] > S[j]:
            value = S[i]
            S[i] = S[j]
            S[j] = value
result = ""
for i in range(N):
    result += S[i]
print(result)

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

Solution (Python):
a,b=(int(x) for x in input().split())
list=[]
for i in range(a):
  aaa=input()
  list.append(aaa)
list.sort()
for i in list:
  print(i,end="")

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