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:
n, l = map(int, input().split())                            
array = [input() for _ in range(n)]
 
array.sort()
 
result = ''.join(array)
print(result)

Submission status: Accepted

Solution code:
INT_MAX=10**18+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#################################################################################
n,l=INPUT()
A=[]
for i in range(n):
    x=input()
    A.append(x)
A.sort()
ans=""
for ele in A:
    ans+=ele
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(*sorted(listA),sep="")

Submission status: Accepted

Solution code:

n_and_l = input()

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


text = []

for num in range(0, n):
    text.append(input())


for object in range(1, n):
    for compare in range(0, object):
        if text[object] < text[compare]:
            tmp = text[object]
            text[object] = text[compare]
            text[compare] = tmp

answer = ""

for num in range(0, n):
    answer = answer + text[num]

print(answer)

Submission status: Accepted

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

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()
print(*S,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
N,L = LI()
S = sorted([S() for _ in range(N)])
print(*S,sep='')

Submission status: Accepted

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

S.sort()

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def main():
    input = sys.stdin.readline
    n, l = map(int, input().split())
    s = [input().rstrip() for i in range(n)]

    s.sort(key=lambda x: [x[i] for i in range(l)])

    print(''.join(s))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

List2 = sorted(List)
print("".join(List2))

Submission status: Accepted

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

s_s = sorted(s)

print("".join(s_s))

Submission status: Accepted

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

s_s = sorted(s)

print("".join(s_s))

Submission status: Accepted

Solution code:

def myAnswer(N:int,L:int,S:list)->str:
   S.sort()
   ans = ""
   for s in S:
      ans+=s
   return ans

def modelAnswer():
   tmp=1
def main():
   N,L=map(int,input().split())
   S =[]
   for _ in range(N):
      S.append(str(input()))
   print(myAnswer(N,L,S[:]))


if __name__ == '__main__':
   main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

nl.sort()

for x in nl:
    print(x, end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = sorted(S)
res = ""
for s in S:
    res += s
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, l = map(int,input().split())
    s_sorted = sorted([input() for i in range(N)])
    print("".join(s_sorted))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number,length=map(int,input().split())
input_list=[]
out=''
for i in range(number):
    input_list.append(input())
input_list.sort()
for i in input_list:
    out+=i
print(out)

Submission status: Accepted

Solution code:
p = input('')
q = p.split(' ')
n = int(q[0])
a = [input('') for i in range(n)]
b = sorted(a)
print(''.join(b))

Submission status: Accepted

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

S.sort()

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

print(s)

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

Submission status: Accepted

Solution code:
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 = int(input())
	n,l = IN()
	ss=[]
	for _ in range(n):
		s = input()
		ss.append(s)
	ss.sort()
	return ''.join(ss)
	
	
	
#+++++
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
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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

s.sort()

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

Submission status: Accepted

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

S = [0] * N

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

S = sorted(S)

result = ''

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

print(result)

Submission status: Accepted

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

S.sort()
#print(S)
ans = ''
for el in S:
    ans += el
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, _ = [int(x) for x in input().split()]
S = sorted([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))
a = "".join(sorted(S))
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

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

print(''.join(s))

Submission status: Accepted

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, l = map(int,input().split())
    s = []

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, l = map(int,input().split())
    s = []

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

    s_sorted = sorted(s)
    answer = ""

    for i in range(N):
        answer += s_sorted[i]

    print(answer)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import collections, math, bisect

local = False
if local:
    file = open("input.txt", "r")
    import time

def inp():
    if local:
        return file.readline().rstrip()
    else:
        return input().rstrip()

def ints():
    return [int(_) for _ in inp().split()]


if local:
    start=time.time()

N, L = ints()
S = [""]*N

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

S.sort()

ans = []

for s in S:
    ans.append(s)

print("".join(ans))


if local:
    fin = (time.time()-start)*1000
    print("{:.2f}".format(fin) + "ms")

Submission status: Accepted

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

sj = sorted(si)

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

print(sans)

Submission status: Accepted

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

s = [input() for i in range(I[0])]

s = sorted(s)

mojiretu = ''.join(s)

print(mojiretu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def order(str1, str2):
  for i in range(len(str1)):
    if ord(str1[i]) > ord(str2[i]):
      return False
    elif ord(str1[i]) == ord(str2[i]):
      continue
    else:
      return True
 
def sort(str_list):
  for i in range(len(str_list) - 1):
    for j in range(i + 1, len(str_list)):
      if not order(str_list[i], str_list[j]):
        temp = str_list[i]
        str_list[i] = str_list[j]
        str_list[j] = temp
  ans = ""
  for i in str_list:
    ans += i
  return ans
 
line1 = input().split()
n = int(line1[0])
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
# リスト内包表記
# 以下と同等
## strs = []
## for i in range(n):
##    strs.append(input())
strs = [input() for _ in range(n)]
strs.sort()
strs = ''.join(strs)
print(strs)

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())
li=[]
while n>0:
    a=input()
    li.append(a)
    n-=1
kk=sorted(li)
moji=''
for x in kk:
    moji+=x
print(moji)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = list(sorted(S))

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cc,tot=(int(x) for x in input().split())
al=[]
for i in range(cc):
  al.append(input()) 

al.sort()
answer=''.join(al)
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = [input() for _ 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())
l = list()
for i in range(0, N):
    s = input()
    l.append(s)
l = sorted(l)
mojiretsu = "".join(l)
print(mojiretsu)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
	n, m = map(int, input().split())
	w = list()
	ans = ""
	for _ in range(n):
		w.append(input())
	w.sort()
	for word in w:
		ans += word
	print(ans)

resolve()

Submission status: Accepted

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


l.sort()
blank = ""
for i in range(len(l)):
	blank = blank + l[i]

print(blank)

Submission status: Accepted

Solution code:

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


if __name__ == "__main__":
    resolve()

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:
def main():
    N, L = map(int, input().split())
    word_list = list()

    for i in range(N):
        word_list.append(input())
    
    word_list.sort()

    print("".join(word_list))
main()

Submission status: Accepted

Solution code:
N,L = map(int,input().split())
S = [input() for i in range(N)]
S = sorted(S)
for n in range(N):
  tmp = S.pop(0)
  print(tmp,end = "")

Submission status: Accepted

Solution code:

import collections


def solve(n, l, strings):
    strings.sort()

    return "".join(strings)


[n, l] = list(map(int, input().strip().split()))
strings = []

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

print(solve(n, l, strings))

Submission status: Accepted

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

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, 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, L = map(int, input().split())
S = [input() for i in range(N)]
S.sort()
#print(*S, sep="")
print("".join(S))

Submission status: Accepted

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

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

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 = list(map(int,input().split()))
a =[input() for i in range(N)]


a.sort()

print("".join(a))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n-1):
  s = input()
  for j in range(len(sorted)):
    if s < sorted[j]:
      sorted.insert(j, s)
      break
    if j == len(sorted)-1:
      sorted.append(s)
ans = ""
for x in sorted:
  ans = ans + x
print(ans)

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
s = list()
for i in range(n):
    s.append(str(input()))
s.sort()

print(''.join(s))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N, L = map(int, sys.stdin.readline().split(" "))
S = sorted([sys.stdin.readline().rstrip() for i in range(N)])
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

moji=[]

for i in range(n):
    moji.append(input())
moji.sort()

print("".join(moji))

Submission status: Accepted

Solution code:
import numpy
n, l = list(map(int, input().split()))
a = []

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

a.sort()

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

Submission status: Accepted

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

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

for i in range(N):
    if (min(S) == "~XXX"):
        break

    print(min(S).replace('\n',''),end="")
    # print(S.index(min(S)))
    S[S.index(min(S))] = "~XXX"

Submission status: Accepted

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

print(''.join(sorted(Iroha)))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N, L = map(int, input().split())
    S = [None] * N
    for i in range(N):
        S[i] = input().rstrip()
    S.sort()
    ans = "".join(S)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

s_list = sorted(s_list)

answer = ''.join(s_list)
print(answer)

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

Submission status: Accepted

Solution code:
from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n,l=MI()
    ss=[SI() for _ in range(n)]
    ss.sort()
    print("".join(ss))

main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

print(''.join(sorted(input_lines)))

Submission status: Accepted

Solution code:
N, L = list(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 = []
for _ in range(N):
    S.append(input())
S.sort()
print("".join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 = [input() for _ in range(n)]
s = sorted(s)
for i in range(n):
    print(s[i], end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n,l = list(map(int,input().split()))
c = [input() for i in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#Solve
if __name__ == "__main__":
    solve()

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

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:
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
ans = ''.join(S)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 042: B – 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
n, l = map(int, input().split())
s = [input() for _ in range(n)]
print(''.join(sorted(s)))

Submission status: Accepted

Solution code:
# ABC 042: B – 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
n, l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math
import itertools
import statistics
#import numpy as np
import collections

#n = int(input())
n, l = list(map(int, input().split()))
#a = 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="")