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):
s = input().split()


wordCNT = int(s[0])

mylist = []

for num in range(wordCNT):
    mylist.append(input())

mylist.sort()

print(''.join(mylist))

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

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

list.sort(reverse=False)

for i in range(N):
  R += list[i]
  
print(R)

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

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

ss.sort()

print("".join(ss))

Solution (Python):


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,L=MI()
    S=[]
    for i in range(N):
        s=input()
        S.append(s)
        
    S.sort()
    print(''.join(map(str, S)))

main()

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

for i in range(n):
    line = input()
    l.append(line)
    
print("".join(sorted(l)))

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

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

Solution (Python):
N,L = map(int,input().split())
S = sorted([input() for _ in range(N)],reverse=False)
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())
A=[]
for i in range(N):
    s=input()
    A.append(s)
B=sorted(A)
for i in range(N):
    print(B[i],end="")

Solution (Python):
NL = [ x for x in map(int,input().split()) ]
cha = []
i = 0
while i < NL[0]:
  cha.append(input())
  i += 1
print(''.join(sorted(cha)))

Solution (Python):
from sys import stdin

lines = stdin.readlines()
counter = []
each_line = []
for i, line in enumerate(lines):
    if i == 0:
        counter = [int(x) for x in (line.rstrip().split())]
    else:
        each_line.append(str(line.rstrip()))

line_sort = sorted(each_line)

answer = str()
for i in range(counter[0]):
    answer += line_sort[i]

print(answer)

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

A.sort()
print("".join(A))

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

Solution (Python):
N, L, *S = open(0).read().split()
S.sort()
print(''.join(S))

Solution (Python):
import sys

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

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

s.sort()

min_str = ""

for item in s:
    min_str += item

print("{}".format(min_str))

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

Solution (Python):

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

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

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

Solution (Python):
n,l=map(int,input().split())
s=sorted(list(input() for i in range(n)))
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()
ans = ''
for i in range(n):
    ans = 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):
s, l = map(int, input().split())

d = []
for _ in range(s):
  d.append(input())
d.sort()
print(''.join(d))

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

Solution (Python):
n,l = map(int, input().split())
s = [[""]*l for syoki in [""]*n]
flag = [["ok"]*l for syoki in ["ok"]*n]
dummy = ""

for i in range(n):
  dummy = input()
  count = 0
  for q in dummy:
    s[i][count] = q
    count = count + 1


for j in range(n):
  for k in range(n-1):
    for m in range(l):
      if s[j][m] < s[k][m]:
        dummy = s[j]
        s[j] = s[k]
        s[k] = dummy
        break
      elif s[j][m] > s[k][m]:
        break
out = ""  
for f in range(n):
  for g in range(l):
    out = out + s[f][g]
print(out)

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

ans = []

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

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

Solution (Python):

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

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
n,m = map(int,readline().split())
lst1 = []
for i in range(n):
    lst1.append(readline().rstrip().decode('utf-8'))

lst1.sort()

print("".join(lst1))

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

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

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

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

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

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

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

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

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

S.sort()

print(''.join(S))

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

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

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

Solution (Python):
num = list(map(int,input().split()))
word = [input() for i in range(num[0])]
print(''.join(sorted(word)))

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

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

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

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

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

a.sort()

for i in range(num):
  print(a[i], end="")
print()

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

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

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

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

s = sorted(s)

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

print(sj)

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

Solution (Python):
a,b=map(int,(input().split()))
li=[]
for i in range(a):
    li.append(input())
li2=sorted(li)
c=li2[0]
for j in range(1,a):
    c+=li2[j]
print(c)

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

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

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

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

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

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

s.sort()

ans = ""

for v in s:
    ans += v

print(ans)

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

s.sort()

ans = ""

for v in s:
    ans += v

print(ans)

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

    for i in sorted(S):
        print(*i,sep='',end='')
    print()


resolve()

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

print(*s,sep="")

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

s=[input() for _ in range(n)]
s.sort()
print("".join(s))

Solution (Python):
import sys
n, l = map(int, input().split(" "))
lis = sys.stdin.readlines()
lis.sort()
for i in lis:
    print(i.rstrip(), end = '')

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

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

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

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

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

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

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

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

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

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

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

print(''.join(sorted(x)))

Solution (Python):
line = input().split(' ')
N = int(line[0])
L = int(line[1])
List = []
for i in range(N):
  List.append(input())
List.sort()
for i in List:
  print(i,end="")

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

Solution (Python):
n,l=map(int,input().split())
dic={}
for i in range(n):
    text=input()
    if text[0] not in dic:
        dic[text[0]]=[text]
    else:
        dic[text[0]].append(text)
for i in dic:
    dic[i]=sorted(dic[i])
dic=sorted(dic.values())
for i in dic:
    try:
        for j in i:
            print(j,end='')
    except:
        print(i,end='')

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

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

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

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

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

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 = []
i = 0
while i<n:
  Li.append("".join(input()))
  i += 1
else:
  Li.sort()
  print("".join(Li))

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())
print("".join(sorted(s)))

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().strip().split())
s = [""]*n
for i in range(n):
    s[i]=input()
s.sort()
sol = ""
for i in s:
    sol += i
print(sol)

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

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

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

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

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

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

Solution (Python):
n = input().split()
N = int(n[0])
L = int(n[1])
a = []
for i in range(N):
    b = input()
    a.append(b)
A = sorted(a)
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 = []
for i in range(n):
    S.append(input())

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

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

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

res = ""
for i in range(n):
    res += min(lst)
    lst.remove(min(lst))

print(res)

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

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

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

Solution (Python):
N,M = map(int, input().split())
A = []
for i in range(N):
    A.append(input())
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 = list(input() for _ in range(N))
S.sort()
print("".join(S))

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

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

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

    S.sort()
    print("".join(S))
if __name__=="__main__":
    main()

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

ans = ''
for i in range(n):
    ans += L[i][1]
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(str(input()))
s.sort()
ans = ''
for i in range(n):
    ans += s[i]
print(ans)

Solution (Python):

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

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

Solution (Python):
def main():
    N, K = (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())
print("".join(sorted([input() for _ in range(N)])))

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

print(*S,sep="")

Solution (Python):
n, l, *s = open(0).read().split()
print("".join(sorted(s)))

Solution (Python):
I=input().split()
N=int(I[0])
L=int(I[1])
s=[]
for _ in range(N):
  s.append(input())
s.sort()
all=""
for i in s:
  all+=i
  
print(all)

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

Solution (Python):
import sys
import os


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

    N, L = list(map(int, sys.stdin.readline().split()))
    S = sorted([line.rstrip() for line in sys.stdin.readlines()])
    print(*S, sep="")


if __name__ == '__main__':
    main()

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

Solution (Python):

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

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

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

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

Solution (Python):
from struct import *

def fun(dct): 
    print(*dct)

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

dct = sorted(S)

for a in dct:
    print(*a, end='')

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

Solution (Python):
import sys, math

def input():
    return sys.stdin.readline()[:-1]

def main():
    N, L = map(int,input().split())
    S = [input() for k in range(N)]
    print("".join(sorted(S)))

if __name__ == '__main__':
    main()

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

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

Solution (Python):

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

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

Solution (Python):
def main():
    string_num, length = map(int, input().split())
    strings = [input() for _ in range(string_num)]
    strings.sort()
    print("".join(strings))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys







from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

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

if __name__=='__main__':
    main()

Solution (Python):


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

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

Solution (Python):
import sys
if __name__ == '__main__':
    N,L= map(int, input().split())
    data=[]
    moji=''
    for i in range(N):
        data.append(input())
    data.sort()
    print(''.join(data))

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

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=input().split()
dic=list()
ans=""
for i in range(int(N)):
    s=input()
    dic.append(s)
dic=sorted(dic)
for c in dic:
    ans=ans+c;
print(ans)

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	a, c = IN()
	ss = [input() for _ in range(a)]
	ss.sort()
	ret = ''.join(ss)
	print(ret)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

s = ''
for i in S:
    s+=i
    
print(s)

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

Solution (Python):
import sys
readline = lambda:sys.stdin.readline().rstrip()
N,L = map(int, readline().split())
ss = [readline() for _ in range(N)]
ss.sort()
ans = ''.join(ss)
print(ans)

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

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

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

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

print(''.join(sorted(ss)))

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

print(lst)

Solution (Python):


a = [int(s) for s in input().split()]

c = []
for _ in range(0, a[0]):
    c.append(input())

d = sorted(c)
ans = ''.join(d)

print(ans)

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

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

strings.sort()

print("".join(strings))

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

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

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

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

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

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

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

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

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

s = [input() for i in range(int(a[0]))]
b = ''

s.sort()

b = ''.join(s)

print(b)

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

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

Solution (Python):



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


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


S.sort()


str = ''.join(S)

print(str)

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

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

s.sort()
for i in range(n):
    a=''.join(s)
print(a)

Solution (Python):
num, length = map(int, input().split())
array = []
for i in range(num):
    array.append(input())
print("".join(sorted(array)))

Solution (Python):
X, L = list(map(int,input().split()))
li = sorted([input() for i in range(X)])
ans = ''

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

Solution (Python):




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

s_list.sort()
print("".join(s_list))

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 = sorted([input() for i 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_ans = sorted(S)

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

print(*s, sep="")

Solution (Python):


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

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

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

if __name__ == '__main__':
    main()

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

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

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

lst = []

for i in range(1,N+1):
	lst.append(input())
  
lst.sort()

print("".join(lst))

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

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):
N,L=map(int,input().split())
S=["0"]*N
for k in range(N):
    S[k]=input()
S.sort()
Answer=""
for k in range(N):
    Answer+=S[k]
print(Answer)

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

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

S.sort()

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

print()

Solution (Python):
def getlist():
    return list(map(int, input().split()))
  
a,b = getlist()
lis = []
for i in range(a):
  lis.append(input().strip())
  
lis.sort()
print("".join(lis))

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

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

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

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

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

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

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

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

word.sort()
print(''.join(_ for _ in word))

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

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

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

for i in range(N-1):
  A += S[i+1]
print(A)

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

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N, L = map(int, input().split())
s = [input()[: -1] for _ in range(N)]
s.sort()
print("".join(s))

Solution (Python):

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