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.



Sample input:
3 3
dxx
axx
cxx


Sample output:
axxcxxdxx

Submission status: Accepted

Solution code:
_,_,*s = open(0).read().split()
print(*sorted(s),sep='')

Submission status: Accepted

Solution code:
N,L,*s = open(0).read().split()
print("".join(sorted(s)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
n, l= map(int, input().split())
words=[]
for i in range(n):
  words.append(input())
words.sort()
for i in range(n):
  print("{}".format(words[i]),end="")

Submission status: Accepted

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

S_sort = sorted(S)

print(''.join(S_sort))

Submission status: Accepted

Solution code:
N,L = map(int, raw_input().split())
a = []
s = ""
for i in range(N):
    b = raw_input()
    a.append(b)
a.sort()
for i in range(N):
    s += a[i] 
print s

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

if __name__ == "__main__":
    
    raw = input()
    N, L = [int(f) for f in raw.split(" ")]
    
    str_list = []
    for i in range(N):
        raw = input()
        str_list.append(raw)
        
    sorted_str = sorted(str_list)
    join_str = "".join(sorted_str)
    
    print(join_str)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().rstrip().split(" ")
t = []
for i in range(int(s[0])):
    t.append(input())
print("".join(sorted(t)))

Submission status: Accepted

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

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

print(*s,sep="")

Submission status: Accepted

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

for _ in range(n):
    s.append(input())
s.sort()
print(''.join(s))

Submission status: Accepted

Solution code:
i = input().split()
s, t = map(int, i)
str_list = []

for i in range(s):
    string = input()
    str_list.append(string)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, _ = map(int, input().split())
l_list = [str(input()) for i in range(N)]
l_list = sorted(l_list)
ans = ''.join(l_list)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, L: int, S: "List[str]"):
    S.sort()
    ret = ''.join(S)
    print(ret)
    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))  # type: int
    L = int(next(tokens))  # type: int
    S = [ next(tokens) for _ in range(N) ]  # type: "List[str]"
    solve(N, L, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

char_list = [input() for i in range(N)]
char_list.sort()
print(''.join(char_list))

Submission status: Accepted

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

Submission status: Accepted

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

S.sort()
for s in S:
    print(s, end='')
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, l = input().split()
a = [input() for i in range(int(n))]
a.sort()
print('{}'.format(''.join(a)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 42 B - iroha loves strings
n, l = [int(el) for el in input().split(' ')]
S = sorted([input() for i in range(n)])
print(''.join(S))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, length = map(int, input().split())
s_list = [input() for i in range(n)]

# リストの各要素を空文字でjoin
s_str = ''.join(sorted(s_list))
print(s_str)

Submission status: Accepted

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

# リストの各要素を空文字でjoin
s_str = ''.join(sorted(s_list))
print(s_str)

Submission status: Accepted

Solution code:
num_word, word_length = map(int, input().split())
li_word = [input() for i in range(num_word)]

sorted_li = sorted(li_word)
con_word = ""
for i in range(num_word):
    con_word += sorted_li[i]
print(con_word)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tmp = input()
N = int(tmp.split(" ")[0])
L = int(tmp.split(" ")[1])
S = []

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

S.sort()
output = ""
for i in range(N):
    output = output + S[i]

print(output)

Submission status: Accepted

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

mojiretu = ''.join(input_str) 
print(mojiretu)

Submission status: Accepted

Solution code:
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


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

Submission status: Accepted

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

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

Submission status: Accepted

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

string=[]
for s in range(n):
    string.append(str(input()))
string.sort()
print(''.join(string))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

Tmp = []
Tmp = input().rstrip().split(' ')

nN = int(Tmp[0])
nL = int(Tmp[1])

sWord = []

for i in range(nN):
  S = input()
  sWord.append(S)

sWord.sort()

for i in range(nN):
  print('%s' %(sWord[i]), end='')

print()

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
s=[]

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

s.sort()

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

Submission status: Accepted

Solution code:

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,L = map(int,input().split())
sentences = []
for i in range(N):
    s = input().rstrip('\n')
    sentences.append(s)

ans =[]
count = 0
while len(sentences)>0:
    add = min(sentences)
    sentences.remove(add)
    ans.append(add)
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
n = n.split(" ")
L = n[1]
N = n[0]

s = [input() for i in range(int(N))]
s.sort()
result = ''
for si in s:
    result += si
print(result)

Submission status: Accepted

Solution code:
n1,n2 = map(int, input().split())

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

s.sort()

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S.sort()

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

def string2num(str):
    _N = len(str)
    num=0
    for n in range(_N):
        num+=alpha2num(str[n])* (26**(_N-1-n))
    return num

if __name__ == "__main__":
    N,L = (int(x) for x in input().split())
    S = []
    S2Num=[]
    for n in range(N):
        _str = input()
        S.append(_str)
        S2Num.append(string2num(_str))
    ans =""
    for key in sorted(range(len(S2Num)), key=lambda k: S2Num[k]):
        ans+=S[key]
    print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=[]
for i in range(a):
    x.append(input())
l=sorted(x)
tmp=""
for i in l:
    tmp+=i
print(tmp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 26 04:05:59 2019

@author: matsui
"""
N,L=map(int,input().split())

abc=[chr(i) for i in range(97,123)]
s=list()
for i in range(N):
    s.append(input())
    
s.sort()
ans=''
for i in range(N):
    ans+=s[i]
        
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = [0] * N

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

S = sorted(S, key=lambda x: [x[i] for i in range(L)])

ans = ''
for item in S:
    ans += ''.join(item)
print(ans)

Submission status: Accepted

Solution code:
str = input().split()
v=""
sa=list()
for i in range(int(str[0])):
    sa.append(input()[:int(str[1])])
sa.sort()
for i in sa:
    v=v+i

print(v)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC042b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, l = map(int, input().split())
s = []
for _ in range(n):
    s.append(input().split("\n")[0])
s.sort()

print(*s, sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
S = list()
result = ''
while n > 0:
    S.append(input())
    n -= 1

for i in sorted(S):
    result += i 

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N,L=input().split()
N=int(N)
L=int(L)
S=[input() for i in range(N)]
S.sort()
str=""
for j in range(N):
    str=str+S[j]
print(str)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

for i in range(N):

    s = input()
    S.append(s)

S.sort()

print ("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = LI()
    a.sort()
    if a == [5, 5, 7]:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    n, l = LI()
    s = SR(n)
    s.sort()
    for i in s:
        print("".join(i), end="")
    print()
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
A = map(str,list(input() for _ in range(N)))
B = sorted(A)

print(''.join(B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*- 


number, length = map(int, input().split())
lst = []
for n in range(number):
    s = input()
    #print(s)
    lst.append(s)
    #print(lst)

lst.sort()
moji = ""
for n in lst:
    moji += n
print(moji)

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
n,L=map(int,input().split())
l=sorted([input() for i in range(n)])
for t in l:print(t,end='')

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def main():
    N, L = map( int, input().split())
    S = [ input() for _ in range(N)]
    S.sort()
    V = [1]*N
    print("".join(S))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ilist = input().split(' ')
n = int(ilist[0])
l = int(ilist[1])

strlist = list()

for i in range(0,n):
	strlist.append(input())

strlist.sort()

answer = ''
for s in strlist:
	answer = answer + s

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Num = [int(n) for n in input().rstrip().split()]

Str = [input().rstrip() for _ in range(Num[0])]

print("".join(sorted(Str)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

S = ''.join(list(sorted(S)))

print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sum_s = ''
for s in sorted(s_list):
    sum_s += s
print(sum_s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

arr.sort()

ans = ""

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC42 B
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)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, typ=int):
    return [typ(input()) for _ in range(n)]


def main():
    n, l = read_h()
    s = ''.join(sorted(read_v(n, typ=str)))
    print(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from operator import add
from functools import reduce
n, l = list(map(int, input().split()))
s = [input() for _ in range(n)]
s.sort()
ss = reduce(add, s)
print(ss)

Submission status: Accepted

Solution code:
n, l = (int(x) for x in input().split())
s_list = []
s = ''
for i in range(n):
  s_list.append(input())
for i in range(n):
  s += s_list.pop(s_list.index(min(x for x in s_list)))
print(s)

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

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

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, L = list(map(int, sys.stdin.readline().split()))
S = [sys.stdin.readline().rstrip() for _ in range(N)]
S.sort()
print(''.join(S))

Submission status: Accepted

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

lst.sort()
ans = ''
for l in lst:
    ans += l
print(ans)

Submission status: Accepted

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

# print(s)
s_sort = sorted(s)
concat = ''.join(s_sort)
print(concat)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N , L= map(int,input().split())
lst = []
for i in range(N):
    lst.append(input())
lst.sort()
Str = ''
for j in range(N):
    Str += lst[j]
print(Str)

Submission status: Accepted

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

Submission status: Accepted

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

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

list.sort()
string = ""
for s in list:
    string += s

print("".join(string))

Submission status: Accepted

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

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

list.sort()
str = ""
for s in list:
    str += s

print(str)

Submission status: Accepted

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

list.sort()
string = ""
for l in list:
    string += l

print(string)

Submission status: Accepted

Solution code:
row = input().split()
N = int(row[0])
L = int(row[1])
row2 = [input().split() for i in range(N)]
s = []
for i in range(N):
    s.append(row2[i][0])
s.sort()
ans = "".join(s)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N, L = map(int,input().split())
S = sorted([s for s in stdin.read().splitlines()])
print("".join(S))

Submission status: Accepted

Solution code:
N , L= map(int,input().split())
lst = []
for i in range(N):
    lst.append(input())
lst.sort()
Str = ''
for j in range(N):
    Str += lst[j]
print(Str)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L = map(int,input().split())
Strings = list()
for i in range(N):
    Strings.append(input())

ansString=""
for i in range(len(Strings)):
    for j in range(len(Strings)-1,i,-1):
        if Strings[j] < Strings[j-1]:
            Strings[j], Strings[j-1] = Strings[j-1], Strings[j]
            
for k in Strings:
    ansString += k
    
print(ansString)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L=map(int, input().split())
S=[]
for i in range(N):
  S.append(input())
S.sort()
result=''
for j in range(N):
  result+=S[j]

print(result)

Submission status: Accepted

Solution code:
N, L = list(map(int, input().split(' ')))
#print(N, L)

S = []
for i in range(N):
    S.append(list(input()))
#print(S)
S.sort()
#print(S)

for word in S:
    for char in word:
        print(char, end='')
print()

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
s = []
for i in range(N):
	s += [input()]

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

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = list(input() for i in range(N))
S.sort()
str = ""
for i in S:
    str += i
print(str)

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = list(input() for i in range(N))
str = ""
for i in range(N-1):
    for j in range(N-1):
        if S[j+1] + S[j] <= S[j] + S[j+1]:
            S[j], S[j+1] = S[j+1], S[j]
for i in S:
    str += i
print(str)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N, L = map(int, input().split())
arr = [input() for i in range(N)]
sort_arr = sorted(arr)
for i in range(len(sort_arr)):
    print(sort_arr[i], end = "")

Submission status: Accepted

Solution code:
def main():
    n, l = map(int, input().split())
    words = [input() for i in range(n)]
    # words = []

    # for i in range(n):
    #     words.append(input())

    words.sort()
    print(''.join(words))

if __name__ == "__main__":

    main()

Submission status: Accepted

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

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

    words.sort()
    print(''.join(words))

if __name__ == "__main__":

    main()

Submission status: Accepted

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

print(''.join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

s.sort()

a =""

for i in s:
    a += i
    
print(a)

Submission status: Accepted

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

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

S = sorted(S)
str = ''
for i in range(N):
    str += S[i] 
print(str)