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

words = [""] * n

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

words.sort()

print("".join(words))

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, l = [int(x) for x in input().split()]
s = [0] * n
for i in range(n):
    s[i] = input()
s.sort()
print(''.join(s))

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, L = nl()
Ss = []
for i in range(N):
    Ss.append(s())
print(''.join(sorted(Ss)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())

N,L = LI()
S = [0 for i in range(N)]
for i in range(N):
    S[i] = str(input())

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

Submission status: Accepted

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


abc()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(len(lst)):
    ans += lst[i]
    
print(ans)

Submission status: Accepted

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

S.sort()

S2 = ""

for item in S:
    S2 += item

print(S2)

Submission status: Accepted

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

S_list.sort()
print(''.join(S_list))

Submission status: Accepted

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

S_list.sort()

ans = ''
for s in S_list:
    ans += s
print(ans)

Submission status: Accepted

Solution code:
# B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
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())
words=[]
for i in range(n):
  words.append(input())
for i in range(l-1,-1,-1):
  words.sort(key=lambda x:ord(x[i]))
ans=""
for i in range(n):
  ans+=words[i]
print(ans)

Submission status: Accepted

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

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

print(string)

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

for word in s:
  ans += word

print(ans)

Submission status: Accepted

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

for i in sorted(S):
    print(i,end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N, L = mi()
print(''.join(sorted([input() for _ in range(N)])))

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

lst.sort()
ans = ""
for i in lst:
    ans += i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 長さが同じなので単純
N,L = map(int,input().split())
S = [input() for _ in range(N)]
S.sort()
answer = ''.join(S)
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

s.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

sortedli = sorted(li)

ans = ''

for s in sortedli:
  ans += s

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(sorted(strs)))

Submission status: Accepted

Solution code:
nk = list(map(int,input().split(' ')))
doc = []
for i in range(0,nk[0]):
  #doc[i] = input()
  doc.append(input())

doc.sort()  
print(''.join(doc))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n,l=map(int,input().split(' '))
    l_list=[]
    for i in range(n):
        l_list.append(input())
    sorted_l = sorted(l_list)
    for i in sorted_l:
        print(i,end='')

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

arr = list()
for i in range(0, n):
    arr.append(input())
arr.sort()

for str in arr:
    print(str, end="")
print()

Submission status: Accepted

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

print(''.join(sorted(word, reverse=False)))

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = []
for i in range(N):
  s_i = input().strip()
  S.append(s_i)
S = sorted(S)
print("".join([x for x in 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())
S=[input() for _ in range(N)]
S.sort()
answer=""
for i in range(N):
    answer+=S[i]
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
int = list(map(int, input().split()))
li = [input() for i in range(int[0])]
li = sorted(li)
for i in range(int[0]):
    print(li[i], end="")

Submission status: Accepted

Solution code:
from functools import reduce


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

def concat_str(a, b):
    return a + b

s.sort()
print(reduce(concat_str, s))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N,L = list(map(int, input().split()))
list = []
for n in  range(N):
    list.append(input())
list.sort()
literal = ""
for n in  range(N):
    literal +=list[n]
print(literal)

Submission status: Accepted

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

Submission status: Accepted

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

list = sorted([input() for i in range(n)])
print("".join(list))

Submission status: Accepted

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

S.sort()

for n in range(1,N):
    S[0] = S[0]+S[n]

print(S[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(sorted(s_list)))

Submission status: Accepted

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

dic=[]

for i in range(n):
    x=input()
    dic.append(x)

print("".join(sorted(dic)))

Submission status: Accepted

Solution code:
N,L = list(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()
print("".join(s))

Submission status: Accepted

Solution code:
N, _ = 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.sort()
ans=""
for i in s:
    ans+=i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())
sor =S.sort()
ans = ''.join(S)
print(ans)

Submission status: Accepted

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

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

sort_S = sorted(S)

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

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())
Ss = []
for i in range(N):
    S = input()
    Ss.append(S)
Ss = sorted(Ss)
ans = ""
for S in Ss:
    ans += S

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number,length = map(int,input().split())
string = [input() for i in range(number)]
string.sort()
for i in range(number):
    print(string[i] , end = "")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(''.join(ss))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(n, l):
  ss = [input() for i in range(n)]
  ss.sort()
  return ''.join(ss)
  
if __name__ == '__main__':
  nl = [int(n) for n in input().split(' ')]
  n = nl[0]
  l = nl[1]
  print(f(n, l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力
# スペース区切りの整数の入力(定数)
n, l = map(int, input().split())

#Class-B 行ごとの入力(n行)
input_list = []
for i in range(n) :
    a = input()
    input_list.append(a)
    
# 計算と出力
input_list.sort(reverse=False)
print("".join(input_list))

Submission status: Accepted

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

Submission status: Accepted

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

sorted_S = sorted(S)

ans=''

for s in sorted_S:
    ans += s

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
dic={}
data=[]

for _ in range(N):
    word=input()
    data.append(word)

data=sorted(data)
ans=''
for d in data:
    ans+=d





# for _ in range(N):
#     word=input()
#     if not word in dic:
#         dic[word]=1
#     else:
#         dic[word]+=1
#
# ans=''
#
# dic=sorted(dic.items())
#
# for k,v in dic:
#     for _ in range(v):
#         ans+=k

print(ans)

Submission status: Accepted

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

for _ in range(N):
    word=input()
    if not word in dic:
        dic[word]=1
    else:
        dic[word]+=1

ans=''

dic=sorted(dic.items())

for k,v in dic:
    for _ in range(v):
        ans+=k

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n,l=map(int,input().split(" "))
#空のリスト
alist=[]
#文字列の入力、リスト化
for _ in range(n):
  alist.append(input())
#並び替え
alist.sort()
#結合
alist2="".join(alist)
print(alist2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(''.join(sorted(words)))

Submission status: Accepted

Solution code:
import itertools

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

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())
list1 = []

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

print("".join(list1))

Submission status: Accepted

Solution code:
#B問題
N , L = map(int, input().split())
S = []
for i in range(N):
    S.append(input())
    
S.sort()
ans = ""
for k in range(N):
    ans += S[k]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
s = list()
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())

k=[]

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

x=sorted(k)
z="".join(x)

print(z)

Submission status: Accepted

Solution code:
def min_join(strings):
    """文字を全て結合して、辞書順で最も小さくなる文字を探す。"""
    strings.sort()
    return ''.join(strings)


def main():
    N, L = (int(i) for i in input().split())
    strings = [input() for _ in range(N)]
    print(min_join(strings))
    

main()

Submission status: Accepted

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

Submission status: Accepted

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

WORDS.sort(key=str,reverse=False)

#print(WORDS)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = sorted(S)

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

Submission status: Accepted

Solution code:
# -*- coding: UTF-8 -*-
N, L = map(int, input().split())
a = [input() for i in range(N)]
a.sort()
b = "".join(a)
print(b)

Submission status: Accepted

Solution code:
n,l=input().split();s=[input() for _ in range(int(n))];print("".join(sorted(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())
str_list = []
for _ in range(N):
    str_list.append(input())
str_list = sorted(str_list)
ans = ""
for string in str_list:
    ans += string
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
n, l = list(map(int, input().rstrip().split()))
lst = sorted([input().rstrip() for _ in range(n)])
for i in lst:
    print(i, end="")

Submission status: Accepted

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

english.sort()
S=''
for i in range(N):
    S=S+english[i]

print(S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	N, L = map(int, input().split())
	S = list()
	for _ in range(N):
		s = input()
		S.append(s)
	S.sort()
	ans = "".join(S)
	print(ans)


if __name__ == '__main__':
	main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def task_b():
    """
    https://atcoder.jp/contests/abc042/tasks/abc042_b
    """
    n, _ = map(int, input().split())
    sss = [input().strip() for _ in range(n)]
    
    sss.sort()
    print(''.join(sss))


task_b()

Submission status: Accepted

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

S.sort()
ans = ""
for x in S:
    ans += x

print(ans)

Submission status: Accepted

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

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

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

print(''.join(strings))

Submission status: Accepted

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

def f(s1, s2, l):
    for i in range(l):
        if master.index(s1[i]) == master.index(s2[i]):
            continue
        elif master.index(s1[i]) > master.index(s2[i]):
            return 'greater'
        elif master.index(s1[i]) < master.index(s2[i]):
            return 'less'
    return 'equal'

for _ in range(N):
    if _ == 0:
        S.append(input())
    else:
        s = input()
        max_iter = len(S)
        for i in range(max_iter):
            compared = f(s, S[i], L)
            if compared == 'greater' and i == max_iter-1:
                S.append(s)
                break
            elif compared == 'less':
                S.insert(i, s)
                break
            elif compared == 'equal':
                S.insert(i, s)
                break
            else:
                continue

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

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:
import sys
from collections import Counter

n, l = map(int, input().split())
s_list = sorted([input() for _ in range(n)])

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 = sorted(S)

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

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

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 = [int(x) for x in input().split()]
print("".join(sorted([input() for _ in range(N)],reverse=False)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Ss = sorted(Ss)
print(''.join(Ss))

Submission status: Accepted

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

Submission status: Accepted

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

list1.sort()
print(''.join(list1))

Submission status: Accepted

Solution code:

def read_input():
    n, l = map(int, input().split())

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

    return n, l, slist

if __name__ == '__main__':
    n, l, slist = read_input()

    slist.sort()
    print(''.join(slist))

Submission status: Accepted

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

Submission status: Accepted

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

lists.sort()

s=""
for i in lists:
  s+=i
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

alphabet = []
for i in range (N):
    word = input()
    alphabet.append(word)
    
alphabet.sort()
print(''.join(alphabet))

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