Problem:
 Score : 200 points    Problem Statement Iroha has a sequence of N strings S_1, S_2, ..., S_N . The length of each string is L .  She will concatenate all of the strings in some order, to produce a long string.  Among all strings that she can produce in this way, find the lexicographically smallest one.  Here, a string s=s_1s_2s_3 ... s_n is lexicographically smaller than another string t=t_1t_2t_3 ... t_m if and only if one of the following holds:  There exists an index i(1≦i≦min(n,m)) , such that s_j = t_j for all indices j(1≦j<i) , and s_i<t_i .  s_i = t_i for all integers i(1≦i≦min(n,m)) , and n<m .       Constraints  1 ≦ N, L ≦ 100  For each i , the length of S_i equals L .  For each i , S_i consists of lowercase letters.         Input The input is given from Standard Input in the following format:  N  L  S_1  S_2 : S_N       Output Print the lexicographically smallest string that Iroha can produce.        Sample Input 1 3 3
dxx
axx
cxx      Sample Output 1 axxcxxdxx  The following order should be used: axx , cxx , dxx .

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

s.sort()
ans = []
for i in s:
    ans1 = [chr(j) for j in i]
    ans2 = ''.join(ans1)
    ans.append(ans2)

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

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

choniki = str(S[0])

for i in range (1, N):
	choniki=choniki+S[i]

print(choniki)

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

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 = map(int,input().split())
s = []
for i in range(n):
    r = input()
    s.append(r)
    
s.sort()
ans = ""
for i in s:
    ans += i
print(ans)

Solution (Python):

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

c.sort()
print("".join(c))

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 _ in range(n)]

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

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

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

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

S.sort()

print("".join(S))

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
from decimal import Decimal
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,l = inpl()
s = [input() for _ in range(n)]
s.sort()
L = ''
for i in s:
    L += i
print(L)

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n, l = MAP()
s = [STR() for _ in range(n)]
s.sort()
print(''.join(s))

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 _ in range(n)]
S.sort()
ret = ''
for s in S:
    ret += s
print(ret)

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,l = LI()
    s = [input() for i in range(n)]
    s.sort()
    for i in s:
        print(i,end = "")
    print()
    return


if __name__ == "__main__":
    solve()

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

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

Solution (Python):
print(*sorted(open(0).read().split()[2:]),sep="")

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

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

Solution (Python):

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

Solution (Python):

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

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

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

print(s)

Solution (Python):

import math
import itertools
import statistics

import collections


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

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

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

s = sorted(S)

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

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_list = []
s_list.append(input())

for i in range(n-1):
  s = input()
  for j in range(len(s_list)):
    if s_list[j] >= s:
      s_list.insert(j, s)
      break
    elif j == len(s_list) - 1:
      s_list.append(s)

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

print(ans)

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

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

Solution (Python):

strs = []
n,l = map(int,input().split())
for i in range(n):
  strs.append(input())
sortstr = sorted(strs)

for str in sortstr:
  print(str,  end='')
print()

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

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

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

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

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

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

a=[]
for i in range(N):
  a.append(input())
a.sort()
b=""
for i in range(N):
  b += a[i]
print(b)

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

print(''.join(s))

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

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

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

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

N,L = map(int,input().split())
S = list()
for i in range(N):
    s = input().rstrip()
    S.append(s)

S.sort()

print("".join(S))

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

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

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

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

Solution (Python):
lis=input().split()
string_list=[input() for i in range(int(lis[0]))]
string_list.sort()
print(''.join(string_list))

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

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

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

sum = ""
for i in sort_list:
  sum += i


print(sum)

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

sum = ""
for i in sort_list:
  sum += i


print(sum)

Solution (Python):

def main():
    t = input().split()
    li = []
    for i in range(int(t[0])):
        li.append(input())
    print(''.join(sorted(li)))



if __name__ == '__main__':
    main()

Solution (Python):


N, L = (int(x) for x in input().split())
S = list(input() for i in range(N))

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

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

Solution (Python):
n, m = map(int, input().split())
newString = ""
for i in range(n): 
    string = input()
    newString = newString + string + " "
words = newString.split()
words.sort()
for i in words: 
    print(i, end="")

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

print("".join(sorted(strings)))

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    b, c = map(int, input().split())
    a =[]

    for i in range(b):
        s = input()
        a.append(s)
    a.sort()

    print("".join(a))

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

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

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

li=sorted(li)
s=''

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

print(s)

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

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

s = []

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

s_ord = [[0]*(l) for i in range(n)]

for i in range(n):
    for j in range(l):
        s_ord[i][j] += ord(s[i][j])

s_ord_sorted = sorted(s_ord)

s_sorted = ""

for i in range(n):
    for j in range(l):
        s_sorted += chr(s_ord_sorted[i][j])

print(s_sorted)

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

M = sorted(M)

print(''.join(M))

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

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

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

a = sorted(l)

print(*a, sep='')

Solution (Python):
lis=input().split()
string_list=[input() for i in range(int(lis[0]))]
string_list.sort()
print(''.join(string_list))

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

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

SS = sorted(S)
ans = ""

for i in range(N):
    ans += SS[i]

print(ans)

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

combined_char = ""

for cl in char_list:
    combined_char += cl

print(combined_char)

Solution (Python):


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

if __name__ == "__main__":
    main()

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

print(''.join(sorted(palavras)))

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

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

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

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

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


mojiretu = ""
S.sort()

for x in S:
    mojiretu += x

print(mojiretu)

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

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def solve(N: int, L: int, S: "List[str]"):
    S.sort()
    print("".join(S))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    L = int(next(tokens))  
    S = [next(tokens) for _ in range(N)]  
    solve(N, L, S)


if __name__ == '__main__':
    main()

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

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

Solution (Python):


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

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

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

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

s.sort()
print(*s,sep="")

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

S.sort()

print(*S, sep="")

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

a = [str(input()) for i in range(N)]

print("".join(list(sorted(a))))

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

print("".join(d))

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

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

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

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

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

a.sort()

print(''.join(a))

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

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

num = list_in[0]
length = list_in[1]

list_str = [None] * num
list_flags = [0] * num

for i in range(num):
    list_str[i] = input()

result = ""
str = "xxxx"
for i in range(num):
    idx = -1
    for j, flag in enumerate(list_flags):
        if flag != 0:
            continue
        elif idx < 0 and flag == 0:
            str = list_str[j]
            idx = j
        else:
            tmp_str = list_str[j]
            if str > tmp_str:
                str = tmp_str
                idx = j

    result = ''.join([result, str])
    list_flags[idx] = 1

print(result)

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

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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key



__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    N, L = mulinputs()
    datas = []
    for _ in range(N):
        datas.append(input())
    datas.sort()
    
    print(''.join(datas))

Solution (Python):
input()
import sys
a = []
for l in sys.stdin:
    a.append(l.replace("\n",""))
b = sorted(a,reverse=True)
c = ""
for i in b:
  c = i + c
print(c)

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

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

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

Solution (Python):

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

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

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

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

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

slist.sort()

print(''.join(slist))

Solution (Python):
N = input().split()
list = []

N = int(N[0])
for i in range(1,N+1,1):
    list.append(input())

list.sort(reverse = False)

ans = ""
for i in range(1,N+1,1):
    ans = ans + list[0]
    list.pop(0)

print(ans)

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

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

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

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

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

text.sort()
print("".join(text))

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

print("".join(s))

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

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

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

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

S = []

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

S.sort()

res = ''

for i in S:
    res += i

print(res)

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

lst = []
for i in range(0, n):
    lst.append(input())

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

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

s = sorted(s)

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

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

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

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

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

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

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

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

Solution (Python):
"""
kari1 = '3 3'
in1 = kari1.split()
mylist = []
mylist.append('dxx')
mylist.append('axx')
mylist.append('cxx')
"""
in1 = input().split()
mylist = []
for num in range(int(in1[0])):
    mylist.append(input())

mylist.sort()

print(''.join(mylist))

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from heapq import heappop, heapify, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
S = [input() for i in range(A)]

S.sort()
print(*S, sep="")

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

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

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

Solution (Python):



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


ans_str = ""
s_list = sorted(s_list)


for s in s_list:
    ans_str += s


print(ans_str)

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

a.sort()

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

print(ans)

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

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

Solution (Python):

import sys
argVec = sys.argv
if len(argVec) > 1:
    GBN_DEBUG = True
else:
    GBN_DEBUG = False

def dprn(s, i):
    if GBN_DEBUG:
        print(", " + s + " = " + str(i), end = "")

def dprns(s):
    if GBN_DEBUG:
        print(", " + s, end = "")

def dprni(i):
    if GBN_DEBUG:
        print(str(i), end=" ")




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


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

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

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

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 = map(int, input().split())

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

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

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

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

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

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

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

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.append(str(input()))

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n, l = MAP()
s = [STR() for _ in range(n)]
s.sort()
print(''.join(s))

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


if __name__ == '__main__':
    main()