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

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

Solution (Python):
import itertools

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

s = [list(input()) for x in range(N)]

s.sort()

print("".join(list(itertools.chain.from_iterable(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 = list(map(int, input().split()))
S = []
for _ in range(N):
    S += [input()]
print(''.join(sorted(S)))

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

L = list([input() for i in range(n)])
L.sort()
word = ""

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

print(word)

Solution (Python):
n, m = 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)]

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

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

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

main()

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

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

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

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

b=''
for i in range(n):
  b+=n_s[i]

print(b)

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

    s.sort()
    r = ""
    for i1 in range(n):
        r = r + s[i1]
    print(r)

if __name__ == '__main__':
    main()

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

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

sorted_S = sorted(S)

print(*sorted_S,sep='')

Solution (Python):
N, L = [int(i) for i in 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())
arr = [''] * n
for i in range(n):
  arr[i] = input()
arr.sort()
ans = ''
for e in arr:
  ans += e
print(ans)

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

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

sorted_S = sorted(S)

for i in sorted_S:
    print(i,end='')

Solution (Python):
class A:

    def solve(self):
        [a, b, c] = sorted([int(x) for x in input().split(" ")])
        if a == 5 and b == 5 and c == 7:
            print("YES")
        else:
            print("NO")

class B:

    def solve(self):
        [n, l] = [int(x) for x in input().split(" ")]

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

        sorted_strings = sorted(strings)

        print("".join(sorted_strings))

B().solve()

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

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

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

for i in range(N):
    A = input()
    a.append(A)

a.sort()
print("".join(a))

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

S = []
for _ in range(N):
  S.append( input() )
 
sd =  sorted(S, key=lambda x: (str(x)[0], x))

print("".join(sd))

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

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

Solution (Python):
from sys import stdin
N, L = [int(x) for x in stdin.readline().rstrip().split()]

data = [stdin.readline().rstrip().split() for _ in range(N)]

flat = [flatten for inner in data for flatten in inner]
flat.sort()

print(''.join(flat))

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

s_sort = sorted(s)
ans = ""
for i in range(n):
    ans += s_sort[i]

print(ans)

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

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

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

Solution (Python):
N, L =list(map(int, input().split()))
array = []
word = ""
for i in range(N):
    s = input()
    array.append(s)
new_array = sorted(array)    
for j in range(N):
    word += new_array[j]
print(word)

Solution (Python):
N, L = map(int, input().split())
l = []
s =""
for i in range(N):
    l.append(input())
lnew = sorted(l)
for j in range (N):
    s += lnew[j]
print(s)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


 
N, L = MAP()
S = [input() for _ in range(N)]
S.sort()
print("".join(S))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7



N, L = MAP()
S = [input() for _ in range(N)]
S.sort()
print("".join(S))

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

Solution (Python):
def main():
    n, l = map(int, input().split())
    s = [input() for i in range(n)]
    ss = sorted(s)
    res = ''
    for i in ss:
        res = res + i
    print(res)
if __name__ == '__main__':
    main()

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

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

slist=[]
for _ in range(N):
  slist.append(input())
slist.sort()
print("".join(slist))

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

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

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

s.sort()

print("".join(s))

Solution (Python):
count , low = map(int, input().split(" "))
li = sorted([input() for s in range(count)])

print(''.join(li))

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

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

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

Solution (Python):
N, L = map(int, input().split())
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 _ 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):
import sys
import bisect
import heapq

sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline

def main():
    n,l = map(int,read().split())
    li = []
    for i in range(n):
        li.append(input())
    li.sort()
    for s in li:
        print(s,end="")
    print()

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N, L = map(int, input().split())
    S = [input().strip("\n") for _ in range(N)]
    S.sort()
    print("".join(S))
   
    
    return 0

if __name__ == "__main__":
    solve()

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

S.sort()

ans = ''
for Si in S:
    ans += Si

print(ans)

Solution (Python):
import sys

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

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

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

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

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

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

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

n, l = [int(x) for x in input().split()]

s = [input().rstrip() for _ in range(n)]

s.sort()

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

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

list = []

for i in range(n):
    list.append("{}".format(input()))

list.sort()

for i2 in range(n):
    print(list[i2],end="")

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7

N, L = MAP()
S = [input() for _ in range(N)]

S.sort()
ans = str()

for x in S:
	ans += x

print(ans)

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

Solution (Python):

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

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

Solution (Python):


N, L = [int(x) for x in input().strip().split(' ')]
S = []
for _ in range(N):
    S.append(input().strip())
S.sort()
print(''.join(S))

Solution (Python):
from collections import defaultdict
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n, l = LI()
s = SR(n)
s.sort()
print(''.join(s))

Solution (Python):

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

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

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

Solution (Python):


"""
Lの文字列N個(s1-sN)
N個の文字列を辞書順にしたあと，くっつけて出力する
"""


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

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

    result_list = sorted(input_list)
    print("".join(result_list))


if __name__ == "__main__":
    main()

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

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

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

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

print(*s, sep='')

Solution (Python):
a=input().split(" ")
list1=[]
c=""


for i in range(int(a[0])):
	b=input()
	list1.append(b)

list2=sorted(list1)

for j in range(int(a[0])):
    c=c+list2[j]

print(c)

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)]
result = ''
s.sort()

for j in s:
    result = result + j

print(result)

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

for j in s:
    result = result + j

print(result)

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

S = sorted(S)

print("".join(S))

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

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

N = l[0]
L = l[1]

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

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

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

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

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

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

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

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

Iloha = []

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

Iloha.sort()

print("".join(Iloha))

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

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

iroha.sort()
print(''.join(iroha))

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

Solution (Python):

def inp():
    return(int(input()))



def inlist():
    return(list(map(int, input().split())))



def instr():
    s = input()
    return(list(s[:len(s)]))



def invr():
    return(map(int, input().split()))


N, L = invr()

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

res = ""
for i in A:
    res += i
print(res)

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

f01()

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

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

for i in c:
    print(i,end="")

Solution (Python):
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n, l = LI()
s = SR(n)
s.sort()
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 = input().split(' ')
N = int(N)
L = int(L)
a = []

for i in range(N):
  a.append(input().rstrip())

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

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

print(A)

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

Solution (Python):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

n,l = imap()
s = []
for i in range(n): s.append(sinput())

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

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

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 f  in range(n)]
string = sorted(s)
print("".join(string))

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

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

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

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Y(): print("Yes"); return
def N(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N,L = IL()
S = SLs(N)

S.sort()

print(*S,sep="")

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

list_of_words = []

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

list_of_words.sort()

answer = ""
for word in list_of_words:
    answer += word

print(answer)

Solution (Python):
import collections


def inputStrOnebyOne():
    s = list(input())
    return s


def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

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

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

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

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

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

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 _ 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())
x =  list(input() for i in range(N))
s = "".join(sorted(x))
print(s)

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

dic.sort()
print(''.join(dic))

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

Solution (Python):
import numpy as np

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

N,L=map(int,input().split())
S=[]
l=[]
for i in range(N):
  S.append(input())
  l.append(alpha2num(S[i]))
l=np.array(l)
l=l.argsort()
s=""
for j in range(N):
  s+=S[l[j]]
print(s)

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

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

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()

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

S = [str(input()) for _ in range(N)]
S.sort()
print(*S,sep="")

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

Solution (Python):
n, l = list(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())
lists = []
for i in range(N):
    lists.append(input())

lists.sort()
print(''.join(lists))

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

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

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

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n, l = mi()
    strings = [input() for _ in range(n)]
    strings.sort()
    print(''.join(strings))


if __name__ == "__main__":
    main()

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

Solution (Python):

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

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

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

Solution (Python):
n,m=map(int,input().split())
ans=[]
for i 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 = sorted(S)
str = ''
for i in range(N):
    str += S_sort[i]
print(str)

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