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:
num = input().split()
str = [input()]
strc = ''
flg = 0
res = ''
for i in range(int(num[0])-1):
#	print(1)
	strc = input()
	for j in range(len(str)):
		if str[j] < strc:
#			print(2)
			flg = 0
		else:
#			print(3)
			flg = j
			break
		j += 1
	flg = -1
	if flg == 0:
		str.append(strc)
	else:
		str.insert(j,strc)
#	print(str)
for x in str:
	res += x
print(res)

Submission status: Accepted

Solution code:
import sys


def solve(inp):
    (N, L) = map(int, inp.readline().split(' '))
    S = sorted([inp.readline() for i in range(N)])

    r = ""
    for s in S:
        r += s.strip()

    return r


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N,L = [int(i) for i in input().split()]
nes = ['t'] * N
for i in range(N):
    nes[i] = input()
nes.sort()
S = ''.join(nes)
Sa = S.replace('\n','')
print(Sa)

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(n):
	d += s[i]

print(d)

Submission status: Accepted

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

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:
# coding: utf-8


def main():

    str_count, _ = map(int, input().split(' '))
    str_join = []

    for _ in range(str_count):
        str_join.append(input())
        
    str_join = sorted(str_join)    

    print(''.join(str_join))

    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 = []
for i in range(N):
    str = input()
    S.append(str)

value = ""
for i in range(N):
    for j in range(i+1,N):
        if S[i] > S[j]:
            value = S[i]
            S[i] = S[j]
            S[j] = value
result = ""
for i in range(N):
    result += S[i]
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
list=[]
for i in range(a):
  aaa=input()
  list.append(aaa)
list.sort()
for i in list:
  print(i,end="")

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:
lengh, count = map(int, input().split())
strlist = []
for i in range(0,lengh):
    strlist.append(input())
strlist.sort()
print("".join(strlist))

Submission status: Accepted

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

print(''.join(sorted(str_lists)))

Submission status: Accepted

Solution code:


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

ans = ''.join(sorted(T))
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 = []
for x in range(n):
   s.append(input())

s.sort()
tmp = [print(x, end='') for x in s]
print()

Submission status: Accepted

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

strs = []
for line in range(N):
    input_str = input()
    strs.append(input_str)

new_list = sorted(strs)

join = ''
for x in new_list:
    join += x

print(join)

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 i in range(n):
    S.append(input())
print(''.join(sorted(S)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 i in range(n):
    s.append(input())

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

Submission status: Accepted

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

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

sl = sorted(sl)

print("".join(sl))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
N, L = map(int, input().split())
list = []
for _ in range(N) :
  list.append(str(input()))

list.sort()

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

print (ans)

Submission status: Accepted

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

s.sort()

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

a = sorted(s)

print("".join(a))

Submission status: Accepted

Solution code:
import math
import fractions

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

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:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

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

w = []

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

w = sorted(w)

print(''.join(w))

Submission status: Accepted

Solution code:
x = list(map(int,input().split()))
a = [str(input()) for i in range(x[0])]

a.sort()

b = "".join(a)
print(b)

Submission status: Accepted

Solution code:
N, L = map(int,input().split())
S = sorted([input().rstrip("\n") for _ 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:
N, L = map(int, input().split())
a = []
for _ in range(N):
    a.append(input())
a.sort()
ans = ''
for i in a:
    ans += i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

List_sorted = sorted(s)
ans = ""

for i in List_sorted:
  ans = ans + i

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print("".join(S))

Submission status: Accepted

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

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

s.sort()
answer = ""

for i in range(len(s)):
	answer += s[i]

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
arr = [input() for i in range(N)]
arr = sorted(arr, key=lambda ele: ele, reverse=False)
ans = ""
for s in arr:
    ans += s
print(ans)

Submission status: Accepted

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

word = [input() for i in range(n)]
word.sort()
a = ""
for i in range(n):
  a += word[i] 
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

word_lst = [input() for i in range(N)]
word_lst.sort()

words = str()

for word in word_lst:
  words += word
print(words)

Submission status: Accepted

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

Submission status: Accepted

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

ls_ans = sorted(ls_s)

ans = ''

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

print(ans)

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()
ans=''
for x in s:
  ans+=x
print(ans)

Submission status: Accepted

Solution code:
ip1 = input().split()
N = int(ip1[0])
L = int(ip1[1])
strings = []
for i in range(N):
    strings.append(input())
strings.sort()
ans = ""
for i in range(len(strings)):
    ans += strings[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = "".join(lix)
print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
#L=int(input())
N, L=input().split()
#S=input()
#T=input()
#S_list=list(S)
#T_list=  list(map(int, input().split(" ")))
#M=int(input())
#drink_list = [list(map(int, input().split(" ")))for i in range(M)]
#print(T_list[1])
N=int(N)
W=int(L)
#C=int(C)
#K=int(K)
T_dummy_list=[]
sentence_list=[]
total=0
mojiretu=""
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#for i in range(K):
# ID_list.append(i+1)
#print(ID_list)
#for i in range(H)
#この下の行が二次元リストの読み込
#intを消して記号を読み込めるようにしたしかしこれでは文字列から読み込んでいるのと同じ
#sentence_list =  [list(input())for i in range(N)]#一文字づつばらして入れてしまう
s = [input() for i in range(N)]
#複数行に複数の入力値を取得し、出力する
#sentence_list =  (list(input())for i in range(N))
#for i in range(H):
#  ppixel_list=list(input())
#  
#print(pixel_list)
i=0
j=0
#high_pixel_list =[['' for i in range(W)]for j in range(2*H)]
#print(high_pixel_list)
#print(pixel_list[0][1])#行　列の順番にかっこが並んでいる

#整数二次元配列を読み込む時のやり方
#gate_list =  [list(map(int, input().split(" ")))for i in range(M)]
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#print(s)
sentence_list=sorted(s)
#print(sentence_list)
for i in range(N):
    mojiretu += sentence_list[i]

print(mojiretu)

Submission status: Accepted

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

l = sorted([input() for _ in range(a)])

print(''.join(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

words.sort()
for i in words:
    print(i, end='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

book = []

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

builded = ""
for i in sorted(book):
    builded += i

print(builded)

Submission status: Accepted

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

Submission status: Accepted

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

# 1次元リストをアンパックを使用して出力する場合、print(*リスト名)で出力する。

Submission status: Accepted

Solution code:
#coding: utf-8
import numpy as np

valueA = list(map(int,input().split()))

valueB = [0] * valueA[0]

for i in range(valueA[0]):
    valueB[i] = input()
    
array = np.array(valueB)

array1 = np.sort(array)

for i in range(len(array1)):
    print(array1[i],end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
s=[""]*n
for i in range(n):
  s[i]=input()
ans=""
for _ in range(n):
  ne=s[0]
  for word in s:
    if word<ne:
      ne=word
  s.remove(ne)
  ans+=ne
print(ans)

Submission status: Accepted

Solution code:
import sys

n, l, *s = sys.stdin.read().split()

def main():
    s.sort()
    t = ''.join(s)
    return t

if __name__ == '__main__':
    ans = main()
    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())
a=[input() for _ in range(n)]
a.sort()
print(*a,sep="")

Submission status: Accepted

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

d  =[input() for i in range(n)]
ans = "".join(sorted(d))


print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=input().split()
b=int(a[0])
data = [input() for i in range(b)]
data.sort()
#print(data)

k="".join(data)
print(k)

Submission status: Accepted

Solution code:
a=input().split()
b=int(a[0])
data = [input() for i in range(b)]
data.sort()
#print(data)

k=""
for i in data:
    k=k+i
print(k)

Submission status: Accepted

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

word_list = sorted(word_list)
word = ""
for i in range(N):
    word += word_list[i]

print(word)

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

Submission status: Accepted

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

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 = list(map(int, input().split()))
S = []
for i in range(N) :
  S.append(str(input()))
sorted_list = sorted(S)
print("".join(sorted_list))

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:
import sys
N,L,*V=sys.stdin.read().split()
print(*sorted(V),sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
n, l = map(int, input().split())
s = [input() for _ in range(n)]
s_sorted = sorted(s)

print(''.join(s_sorted))

Submission status: Accepted

Solution code:
from functools import reduce

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

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

iroha.sort()

print(reduce(lambda a,b: a+b, iroha))

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 i in range(N):
    S.append(input())
S.sort()
print("".join(S))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


def main()->None:
    (N, L) = map(int, input().split())
    range_N = range(N)
    s = []
    for i in range_N:
        s.append(input())
    sorted_s = sorted(s)
    print("".join(sorted_s))







if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N,L = map(int,input().split())
Liste_Iroha = list(map(str,[input() for i in range(N)]))
res = ''
for word in sorted(Liste_Iroha):
    res = res + word
print(res)

Submission status: Accepted

Solution code:
# 長さLの文字列がN個
N,L = map(int, input().split())

# 入力した文字を保存する変数を初期化
moji=[]
# N個の文字列を入力するために、入力を繰り返す
for i in range(N):
    # 文字列を入力
    tmp = input()
    # 文字列をリストに追加
    moji.append(tmp)
    
# 文字列をアルファベット順に並び替える
moji.sort()

# 文字列を結合して表示する
print("".join(moji))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

S.sort()

print(''.join(S))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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 = [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 _ in range(N):
  S.append(input())

Sort=sorted(S)
word=""
for i in range(N):
  word=word+Sort[i]
  
print(word)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().rstrip().split()
N=int(a[0])
L=int(a[1])
l=[]

for i in range(N):
    b=input()
    l.append(b)

l.sort()

ans=""
for i in range(N):
    ans+=l[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, L = list(map(int, input().split()))
S = [input() for i in range(N)]
num = []
ans = []
answer = []
for i in range(len(S)):
    num.append(list(map(ord, str(S[i]))))
num.sort()
for i in range(len(num)):
    ans.append(list(map(chr, num[i])))
for i in range(len(ans)):
    answer.append("".join(ans[i]))
print("".join(answer))

Submission status: Accepted

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

s.sort()
string = ""

for i in s:
    string += i

print(string)

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 = [int(i) for i in input().split()]
lst = []
for _ in range(n):
  lst.append(input())
lst.sort()
s = ''
for i in lst:
  s += i
print(s)

Submission status: Accepted

Solution code:
N, _ = input().split(' ')
N = int(N)

strs = []
for _ in range(N):
    strs.append(input())

print(''.join(sorted(strs)))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = sorted(input() for i in range(a))
print(*c, sep="")

Submission status: Accepted

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

print("".join(sorted(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 = [int(i) for i in input().split()]

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

sorted_strings = sorted(strings)

print(''.join(sorted_strings))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n,k = [int(x) for x in stdin.readline().rstrip().split()]

li = [stdin.readline().rstrip() for _ in range(n)]

li.sort()

print("".join(li))

Submission status: Accepted

Solution code:

def minimum_search(S):
    pass

if __name__ == '__main__':
    _ = list(map(int, input().split()))
    N, L = _[0], _[1]
    S = []
    for i in range(N):
        S.append(input())

    for i in range(N):
        temp=min(S)
        print(temp,end='')
        S.remove(temp)

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
count, lengch = n[0], n[1]
strings = [input() for i in range(count)]

strings.sort()
print("".join(strings))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
import itertools

NLinput = input()
NLinput = [int(x) for x in NLinput.split()]

N = NLinput[0]
L = NLinput[1]

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

S_list = sorted(S_list)
str_temp = ''
for i in S_list:
    str_temp += i
print(str_temp)

Submission status: Accepted

Solution code:
s=list(map(int,input().split()))
num =int(s[0])
length =int(s[1])
statements =list()
while num>0:
    statements.append(input())
    num -=1

statements.sort()

result =''.join(statements)

print(result)

Submission status: Accepted

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

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

ans = ""
for i in range(N):
  t = min(s)
  ans += t
  s.remove(t)

print(ans)

Submission status: Accepted

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

lis=[]
for j in range(n):
    minf=min(P)
    lis.append(minf)
    P.remove(minf)

c=str()
for i in range(n):
    c +=lis[i]

print(c)

Submission status: Accepted

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

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:
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())

s = sorted(s)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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 = []
for _ in range(N):
    S.append(input())

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

Submission status: Accepted

Solution code:
m = input().split()
n = int(m[0])
l = []
for i in range(n):
    l.append(input())

l.sort()
final = ""
for j in range(len(l)):
    final += l[j]

print(final)

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:
# -*- coding: utf-8 -*-
N, L = map(int, input().split()) 
a = []
for i in range(N):
    S = input()
    a.append(S)

a_str_list = sorted(a)
ans = "".join(a_str_list)
print(ans)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,L=MI()
    S=[ST() for _ in range(N)]
    S.sort()
    print(*S,sep="")
if __name__ == '__main__':
    main()

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

s.sort()

s1=''.join(s)
print(s1)