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:
NL = list(map(int, input().split()))
s_list = [input() for i in range(NL[0])]
s_list.sort()
ans = ''.join(s_list)
print(ans)

Submission status: Accepted

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

S = []

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_num, str_len = input().rstrip().split(" ")
str_list = []
for i in range(int(str_num)):
  str_list.append(input())
  
str_list = sorted(str_list)
for string in str_list:
    print(string, end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#N,Lを入力より取得する
n,l = map(int, input().split())

#リストに[s1,s2,...,sn]形式で取得
slist = []
for i in range(n):
    slist.append(input())
"""
if 'a' < 'd':
    print('1')
else:
    print('0')

"""
#リストの要素を辞書早い順にソートする
for i in range(n):
    j = i + 1
    for j in range(n):
        for k in range(l):
            if slist[i][k] < slist[j][k]:
                slist[i], slist[j] = slist[j],slist[i]
                break
            elif slist[i][k] > slist[j][k]:
                break

out = ''            
for i in slist:
    out = out + i

#最終結果を出力
print(out)

Submission status: Accepted

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

Submission status: Accepted

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

s.sort()

ans =""
for x in s:
    ans +=x

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(''.join(sorted(open(0).read().split()[2:])))

Submission status: Accepted

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

str_list.sort()

answer = ''

for i in range(n):
  answer += str_list[i]

print(answer)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L =[int(i)for i in 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 = []
for i in range(N):
    l.append(input())
l.sort()
s = ''
for i in l:
    s += i
print(s)

Submission status: Accepted

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

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

    strs.sort()

    return "".join(strs)

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(sorted(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())
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())
words = []
for i in range(N):
  words.append(input())
new_words = sorted(words)

ans = ''
for w in new_words:
  ans += w
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

li.sort()
print(''.join(li))

Submission status: Accepted

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

for x in s:
    mojiretsu += x
print(mojiretsu)

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
list=[]
i=0
while i<N:
    S=input()
    list.append(S)
    i+=1
list.sort()
print(''.join(list))

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
index=0
listS=[]
while index < n:
    s = input()
    listS.append(s)
    index+=1
listS.sort()

print("".join(listS))

Submission status: Accepted

Solution code:
N,L = map(int,input().split())
s = list(input() for i in range(N))###input from each lines

s_sort = sorted(s)
ans = "".join(s_sort)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = map(int,input().split())
a=list(input() for i in range(n))
a.sort()
s=''
for i in range(n):
  s+=a[i]
print(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()
ans=''
for i in range(N):
    ans+=S[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n=int(input().split()[0])
l=[]
for i in range(n):
  l.append(input())
l.sort()
r=""
for i in l:
  r+=i
print(r)

Submission status: Accepted

Solution code:
amount, length = map(int, input().rstrip().split())
str_list =sorted([input().rstrip() for a in range(amount)])
the_str = ''
for a in range(amount):
  the_str += str_list[a]

print(the_str)

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
p=[input()for i in range(n)]
p.sort()
a=p[0]
for i in range(1,n):
    a+=p[i]
print(a)

Submission status: Accepted

Solution code:
#最初に入力される情報を整理する
str_input_list = input().rstrip().split(' ')

int_input_list = []
for a in str_input_list:
    int_input_list.append(int(a))

amount = int_input_list[0]
length = int_input_list[1]

#文字列を受け取りリストに格納
mojiretu_list = []
for a in range(amount):
    mojiretu_list.append(input())


#文字列を小さい順に並べ、結合
sorted_list = sorted(mojiretu_list)
min_mojiretu = ''
for a in range(amount):
    min_mojiretu += sorted_list[a]

#出力
print(min_mojiretu)
print()

Submission status: Accepted

Solution code:
amount, length = map(int, input().split())
S = sorted([input() for a in range(amount)])
print(''.join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N , L = map(int,input().split())
alpha='abcdefghijklmnopqrstuvwxyz'
def which(a,b):
    l=len(a)
    for i in range(l):
        x=alpha.index(a[i])
        y=alpha.index(b[i])
        if x<y:return True
        if x>y:return False
        
S = []
S.append(str(input()))
for i in range(1,N):
    Si=str(input())
    for j in range(len(S)):
        vs=S[j]
        if which(Si,vs):
            Slist=[]
            Slist.append(Si)
            if j==0:
                S=Slist+S
            else:S = S[:j]+Slist+S[j:]
            break
        if j==len(S)-1:S.append(Si)
        
result=''
for i in range(N):
    result+=S[i]
print(result)

Submission status: Accepted

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

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

sn = []

for _ in range(1, n+1):
  sn.append(input())
  
sn = sorted(sn)

sn = ''.join(sn)

print(sn)

Submission status: Accepted

Solution code:
def execute(n, l, sn):
    return ''.join(sorted(sn))
    pass


if __name__ == '__main__':
    n, l = map(int, input().split())
    sn = []
    for _ in range(n):
        sn.append(input())
    print(execute(n, l, sn))

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
k = []
s = ""
for i in range(a):
    k.append(input())
k.sort()
for i in k:
    s+=i
print(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:
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())
s.sort()
for i in range(n):
    print(''.join(s[i]), end="")

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

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
 
#標準入力からリストの作成
list = []
for _ in range(N):
 i = str(input())
 list.append(i)

#リストのソート
list_a = sorted(list)
 
#リストの結合
mojiretu = ''.join(list_a)
 
print(mojiretu)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n,l = map(int,input().split())
s =[]
for i in range(n):
    s.append((input()))
s.sort()
for i in range(n):
    sys.stdout.write(s[i])
print("")

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

S.sort()

print("".join(S))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def ii():
    return int(input())


def il():
    return list(map(int, input().split()))


N, L = il()
print("".join(sorted([input()[:-1] for _ in range(N)])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A = []

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

Submission status: Accepted

Solution code:
int_n, int_l = map(int, input().split())

li_s = list()

for i in range(int_n):
    li_s.append(input())

print("".join(sorted(li_s)))

Submission status: Accepted

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

A.sort()
B = "".join(A)

print(B)

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.readlines()

strings = []
for n, line in enumerate(lines):
  if n == 0:
    N, L = [int(_) for _ in line.strip().split(' ')]
    continue
  strings.append(line.strip())

def append(source, target):
  source = sorted(source)
  target.append(source[0])
  source.remove(source[0])
  if not len(source):
    return ''.join(target)
  return append(source, target)
  
print(append(strings, []))

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 = "")
print("")

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest042-B
#  TODO https://atcoder.jp/contests/abc042/tasks/abc042_b
import time
from contextlib import contextmanager
# from time import sleep
@contextmanager
def timer(title):
	t0 = time.time()
	yield
	print("{} - done in {:.0f}s".format(title,time.time()-t0) )

def  makeString(givenStringCount):
	givenStringsList = []
	lineRange = range(0,givenStringCount,+1)
	for i in lineRange:
		givenStringsList.append(input().strip())
	givenStringsSortedList = sorted(givenStringsList,reverse=False)
	smallString = "".join(givenStringsSortedList)
	answer = smallString
	return answer


if __name__ == '__main__':
	N,_ = map(int,input().strip().split(' '))
#	with timer("makeString"):
	solution=makeString(N)
	print("{}".format(solution))

Submission status: Accepted

Solution code:
#B - 文字列大好きいろはちゃんイージー
s = input().split()
n = int(s[0])
list = []
for i in range(n):
    list.append(input())
#print(list)
list.sort()
for i in range(len(list)):
    print(list[i], end='')

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp = input().rstrip().split(" ")
N = int(temp[0])
L = int(temp[1])
list1 = []
for i in range(N):
    list1.append(input().rstrip())
list1.sort()
ans = ""
for i in range(N):
    ans += list1[i]
print(ans)

Submission status: Accepted

Solution code:
N,L=map(int,raw_input().split())
S=[]
for i in range(N):
    S.append(raw_input())
#print S
S_num=[]
for i in range(N):
    s_num=""
    for alpha in S[i]:
        s_num+="{:0=2}".format(ord(alpha)-ord("a")+1)
    S_num.append([int(s_num),i])

S_num.sort()
S_sort=[str(s_num[0]) if len(str(s_num[0]))%2==0 else "0"+str(s_num[0]) for s_num in S_num]
S_num_sort="".join(S_sort)
#print S_num_sort

S_num_2=[S_num_sort[i*2:i*2+2] for i in xrange(len(S_num_sort)/2)]
#print S_num_2
S_alpha=[chr(96+int(s_num_2)) for s_num_2 in S_num_2]
Ans="".join(S_alpha)

print Ans

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = []
for i 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)]
c = 0
while c < N:
    for i in range(0, N-1-c):
        if S[i] > S[i+1]:
            S[i], S[i+1] = S[i+1], S[i]
    c += 1
print(''.join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 

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

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

print(ans)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a, b = (int(i) for i in input().split())
    str_list = [input() for i in range(a)]

    print("".join(sorted(str_list)))

Submission status: Accepted

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

print("".join(sorted(literals)))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

list=[input() for i in range(n)]
ans=""

list.sort()
for i in range(len(list)):
    ans = ans + list[i]
    
print(ans)

Submission status: Accepted

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

str_list.sort()

bonded_str = ''

for j in str_list:
    bonded_str += j

print(bonded_str)

Submission status: Accepted

Solution code:
import sys
t_list = []
for i in sys.stdin.readlines():
    t_list.append(i.rstrip())
t_list.pop(0)

def solution(t_list):
    t_list.sort()
    ans_str = ""
    for i in t_list:
        ans_str += i
    return ans_str
    
def main():
    print(solution(t_list))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def listToString(_list, split=""):
    maped_list = map(str, _list)  # mapで要素すべてを文字列に
    mojiretu = split.join(maped_list)
    return mojiretu


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

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
s = sorted([input() for _ in range(n)], key=lambda x: ([x[i] for i in range(l)]))
print("".join(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:
N,L=map(int,input().split())
S=[input() for i in range(N)]
S.sort()
ANS=""
for s in S:
    ANS+=s
print(ANS)

Submission status: Accepted

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

s_list.sort()
ans = ''
for i in range(N):
	ans = ans+s_list[i]

print(ans)

Submission status: Accepted

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

st_list = []

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

st_list.sort()

print("".join(st_list))

Submission status: Accepted

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

Submission status: Accepted

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

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

a.sort()

b=str(a)
b=b.replace(",","")
b=b.replace("[","")
b=b.replace("]","")
b=b.replace("'","")
b=b.replace(" ","")


print(b)

Submission status: Accepted

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

s.sort()
for i in range(n):
    if i != n-1:
        print(s[i],end="")
    else:
        print(s[i])

Submission status: Accepted

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

ans = ''

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

print(ans)

Submission status: Accepted

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

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

str = sorted(str)
for i in range(N):
    print(''.join(str[i]), end = '')

Submission status: Accepted

Solution code:
import sys

def solve(n, l, ls_s):
    sl = sorted(ls_s)
    s = ''
    for i in sl:
        s += i
    print(s)


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    n = int(ws[0])
    l = int(ws[1])
    ls_s = [sys.stdin.readline().strip().split()[0] for j in range(n)]
    return (n, l, ls_s,)

def main():
    solve(*readQuestion())

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

S = sorted(S)
s = ''.join(S)
print(s)

Submission status: Accepted

Solution code:
n,l = input().split()
n=int(n)
e = [[i for i in input().split()] for i in range(n)]
e.sort()
#print(e)
for i in range(n):
  print(e[i][0], end="")

Submission status: Accepted

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

import sys

def solve(n, l, ls_s):
    print(''.join(sorted(ls_s)))


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    n = int(ws[0])
    l = int(ws[1])
    ls_s = [sys.stdin.readline().strip().split()[0] for j in range(n)]
    return (n, l, ls_s,)

def main():
    solve(*readQuestion())

# Uncomment before submission
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
c = [input() for _ in range(a)]
c = sorted(c)

print("".join(c))

Submission status: Accepted

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

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

print("".join(sorted(l)))

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 = list(input() for _ in range(N))

ans = ""

while S:
    min_s = S[0]
    for si in S[1:]:
        min_s = min(si, min_s)
    ans += min_s
    S.remove(min_s)
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N, L = li_input()
    S = [input() for _ in range(N)]

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


main()

Submission status: Accepted

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

words = []
_ap = words.append
for i in range(N) :
	_ap(input())

out_str = ""
_rm = words.remove
while True :
	min_word = min(words)
	out_str += min(words)
	_rm(min_word)
	
	if (len(words) == 0) :
		break;

print(out_str)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s.sort()
for i in range(N):
    ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
Words=[input() for i in range(N)]
Words.sort(key=lambda x: x)
W=""
for w in Words:
  W+=w
print(W)

Submission status: Accepted

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

for i in range(N):
  b.append(a[i])
  
c = sorted(b)
print("".join(c))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l = []
i = 0

l = [input() for i in range(n)]
result = sorted(l)
s = ''.join(result)
# for i in range(n):
print(s)

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
l=[input() for i in range(n)]
l.sort()
#print(l)
a=l[0]
for i in range(1,n):
    a+=l[i]
print(a)

Submission status: Accepted

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

for i in range(a[0]):
  c.append(b[i])
  
d = sorted(c)
print("".join(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = (int(_) for _ in 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())
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()
for i in range(N):
  print(S[i], end="")

Submission status: Accepted

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

Submission status: Accepted

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