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

Submission status: Accepted

Solution code:
import math

line = input()
n, l = [int(x) for x in line.split()]
strings = []
for i in range (n):
	strings.append(input())
strings.sort()
seperator = ''
print(seperator.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())
s = sorted([input() for i in range(n)])
print(*s,sep="")

Submission status: Accepted

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

print("".join(array))

Submission status: Accepted

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


#繰り返しの要素入力
count = 0
list = []

while count < N:
    list.append(input())
    count += 1

s_list = sorted(list)
print(''.join(s_list))

Submission status: Accepted

Solution code:
T = ()

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

S.sort()

T = ','.join(S)
T = T.replace(',','')

print(T)

Submission status: Accepted

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

s_data = sorted(data)
res = ""
for i in range(0,N):
  for item in s_data[i]:
    res += item

print(res)

Submission status: Accepted

Solution code:

import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

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

l.sort()

print(''.join(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##### 解けた #####

N,L=list(map(int,input().split(" ")))
S=[] # 文字列

for _ in range(N): # 入力
    S.append(input())

# アルファベット順に並び替えた後出力
for s in sorted(S):
    print(s,end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, fractions
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

n,l=map(int,input().split())
s=[input() for i in range(n)]
s.sort()
print(*s,sep='')

Submission status: Accepted

Solution code:
#B - 文字列大好きいろはちゃんイージー

mylist=[]
mylist_int=[]
words=[]
sorted_words=[]
result=""


mylist=input().split()
mylist_int=[int(s) for s in mylist]

#numberは文字列の数、lengthは文字列の長さ

number=mylist_int[0]
length=mylist_int[1]

for i in range(number):
    words.append(input())
    #print(words)
    
result=words #初期値
    
#sortedという関数を使う
sorted_words=sorted(words)

#print(sorted_words)

#sorted_wordsを連結する

result="".join(sorted_words)
    
print(result)

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()
print(''.join(lst))

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
s = [input() for i in range(a[0])]
newa= sorted(s)
moji =''
for x in newa:
    moji += x
print(moji)

Submission status: Accepted

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

Submission status: Accepted

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

S=[]
rank=[]
for i in range(N):
    S.append(input())
    rank.append(0)
temp=[]
for i in range(N):
    for j in range(N):
        if(S[i]<S[j]):
           temp.append(int(1))
        else:
            temp.append(int(0))        

for i in range(N*N):
    a=i%N
    rank[a]+=temp[i]
j=0
moji=""
for i in range(N):
    for j in range(N):
        if(i==rank[j]):
            moji=moji+S[j]
print(moji)

Submission status: Accepted

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

Submission status: Accepted

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

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

sorted_strings = sorted(strings)

ans = ""
for string in sorted_strings:
    ans += string
print(ans)

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
s = []
#import pdb; pdb.set_trace();
ans = ''
for i in range(N):
    s.append(input())
s.sort()
for j in range(N):
    ans += s[j]
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(*s,sep='')

Submission status: Accepted

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

A    = sorted([input() for _ in range(N)])

print(*A, sep="")

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n,l=map(int,input().split())
s=[]
ans=''
for i in range(n):
    s.append(input())
s.sort()
for j in range(n):
    ans+=s[j]
print(ans)

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 _ in range(N)]
S.sort()
print(''.join(S))

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,l = inpl()
s = [input() for i in range(n)]
s.sort()
print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ans(s):
  s = sorted(s)
  s = ''.join(s)
  return s
    

if __name__ ==  "__main__":
    n, l = list(map(int, input().split()))
    s = ans([input() for i in range(n)])
    print(s)

Submission status: Accepted

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

Submission status: Accepted

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

while a>0:
    word = input()
    list.append(word)
    a -= 1
    
list.sort()
joined = ''.join(list)
print(joined)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

A.sort()
result = ''.join(A)
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = ''.join(s)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
def exam2():
    N, L = LI()
    S =[None]*N
    for i in range(N):
        S[i] = str(input())
    S.sort()
#    print(S)
    print("".join(map(str,S)))



import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

exam2()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# python3 (3.4.3)
import sys
input = sys.stdin.readline

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

S.sort()

print("".join(S))

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 = map(int,input().split())
ls = sorted([input() for i in range(n)])
print(''.join(ls))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,_ = map(int,input().split())
Data = []
for _ in range(N):
    Data.append(input())
Data.sort()
ans = ''
for s in Data:
    ans += s
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:
#Iroha Loves Strings (ABC Edition)
N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(input())
sort = sorted(S)
R = ""
for i in range(0,N):
    R = R + sort[i]
print(R)

Submission status: Accepted

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

for i in range(N):
  str_list.append(str(input()))

str_list.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N, L = map(int, input().split())
S = []
for _ in range(N):
    s = input()
    S.append(s)
S.sort()
print("".join(S))

Submission status: Accepted

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

print(''.join(S))

Submission status: Accepted

Solution code:
NL = input().split()

iroha = []
i=0
while i < int(NL[0]):
    inp = input()
    iroha.append(inp)
    i+=1

for value in sorted(iroha):
    print(value, end='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

strings.sort()
print(''.join(strings))

Submission status: Accepted

Solution code:

line = input().split()
M=str(line[0])
N = int(line[0])
L = line[1]
S = []

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

answer="".join(Sorted_S)
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, M = map(int, input().split())
strings = [input() for i in range(N)]
result = ''
for _ in range(N):
    index = strings.index(min(strings))
    result += strings[index]
    strings.pop(index)

print(result)

Submission status: Accepted

Solution code:
N,L=[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,l=map(int, input().split())
ans=[]
for i in range(n):
  ans.append(input())
p=sorted(ans)  
for i in p:
  print(i,end="")

Submission status: Accepted

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

li = sorted(li)
ans = ""
for i in range(n):
  ans += li[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

s.sort()

ans =''.join(s)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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 -*-

#文字列の数、文字数の入力
num,len = map(int, input().split())
#文字列の入力
str = list(input() for i in range(num))
last_str = ""

str.sort() #ソート
#文字列の合体
for s in str:
  last_str = last_str + s
print(last_str)

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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())
p=[]
for i in range(n):
    p.append(str(input()))
p.sort()
print(''.join(map(str,p)))

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

Submission status: Accepted

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

S.sort()

result = ''.join(S)

print(result)

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

S_list.sort()
combined_S = ''
for i in range(N):
    combined_S += S_list[i]

print(combined_S)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N, L = map(int, input().split())

# 文字列の入力
LL = []
for i in range(N):
  s = input()
  LL.append(s)

LL.sort()
print("".join(LL))

Submission status: Accepted

Solution code:
n,l = list(map(int,input().split()))
ans = []
for _ in range(n):
    a = input()
    ans.append(a)
    ans = sorted(ans)
print("".join(i for i in 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_li = list()
for _ in range(n):
    s_li.append(input())

s_li.sort()
print(''.join(s_li))

Submission status: Accepted

Solution code:
N, L=list(map(int,input().split()))
s=[]
ans=''
for i in range(N):
    s.append(input())
for i in range(N-1):
    for j in range(N-i-1):
        s1=s[i]
        s2=s[i+j+1] 
        k=0
        while k < L-1 and ord(s1[k])==ord(s2[k]): 
            k+=1
        if ord(s1[k]) > ord(s2[k]):
            s[i]=s2
            s[i+j+1]=s1
    ans+=s[i]
ans+=s[N-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
arr_len_int = int(input().split(' ')[0])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))

Submission status: Accepted

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

n, l = map(int, list(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())
slist=sorted([input() for _ in range(n)])
print(*slist,sep="")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
size, length = map(int, input().split())
strList = []
for counter in range(size):
  strList.append(input())
strList.sort()
print(''.join(strList))

Submission status: Accepted

Solution code:
N_L = input().split(" ")
strings = []
ans = ""
for i in range(int(N_L[0])):
    S = input()
    strings.append(S)
strings.sort()
for j in strings:
    ans = ans + j
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
s=sorted([input() for _ 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="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    lovestrings()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
N = n[0]
L = n[1]

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

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

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 ='')
 
print('\n')

Submission status: Accepted

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

S.sort()

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit, stdin
N, L = [int(_) for _ in stdin.readline().rstrip().split()]
print(''.join(sorted([stdin.readline().rstrip() for _ in range(N)])))

Submission status: Accepted

Solution code:
hoge,fuga=map(int,input().split())
data=sorted([input() for i in range(hoge)])
print("".join(data))

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 s:
  ans += j
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

s = []

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

s.sort()

print(*s, sep='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    N, L = map(int, input().split())
    S = []
    for _ in range(N):
        S.append(input().strip())
    S.sort()
    ans = ""
    for s in S:
        ans += s
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
mat=[]
for i in range(n):
    mat.append(input())
mat.sort(key=lambda x:x)
ans=''
for i in mat:
    ans+=i 
print(ans)

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

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

s = ""
for word in ln:
  s += word
  
print(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:
# -*- coding: utf-8 -*-
count, length = list(map(int, input().split()))

words = []
for i in range(count):
  s = input()
  if len(s) != length:
    continue
  words.append(s)

words = sorted(words)

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

Submission status: Accepted

Solution code:
print("".join(sorted([input() for i in range(int("{}".format(input().split().pop(0))))])))

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 = sorted(map(str,[input() for i in range(n)]),reverse = False)
sstr = ','.join(s).replace(",","")
print(sstr)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# ABC042B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
def main():
    _, _, *A = open(0).read().split()
    A.sort()
    print("".join(A))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print("".join(S))

Submission status: Accepted

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

a=[]
for i in range(n):
    s=input()
    a.append(s)
    
a=sorted(a)    
ans=''
for i in a:
    ans +=i

print(ans)

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

Submission status: Accepted

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

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

s.sort()

for i in range(n):
  res.append(s.pop(0))

result = ''.join(res)
print(result)

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
count = 0
s = []
while count < n:
    s.append(input())
    count += 1
print(''.join(sorted(s)))

Submission status: Accepted

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

Submission status: Accepted

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

List.sort()

for i in range(N):
  print(List[i], end = '')

Submission status: Accepted

Solution code:
N, L = list(map(int, input().split()))
letters = []
nums = []
for i in range(N):
    n = []
    for j in range(L):
        n.append(0)
    nums.append(n)


for i in range(N):
    S = []
    s = input()
    for j in range(L):
        S.append(s[j])
    letters.append(S)

def letter(let):
    if let == "a":
        nums[i][j] = 1
    elif let == "b":
        nums[i][j] = 2
    elif let == "c":
        nums[i][j] = 3
    elif let == "d":
        nums[i][j] = 4
    elif let == "e":
        nums[i][j] = 5
    elif let == "f":
        nums[i][j] = 6
    elif let == "g":
        nums[i][j] = 7
    elif let == "h":
        nums[i][j] = 8
    elif let == "i":
        nums[i][j] = 9
    elif let == "j":
        nums[i][j] = 10
    elif let == "k":
        nums[i][j] = 11
    elif let == "l":
        nums[i][j] = 12
    elif let == "m":
        nums[i][j] = 13
    elif let == "n":
        nums[i][j] = 14
    elif let == "o":
        nums[i][j] = 15
    elif let == "p":
        nums[i][j] = 16
    elif let == "q":
        nums[i][j] = 17
    elif let == "r":
        nums[i][j] = 18
    elif let == "s":
        nums[i][j] = 19
    elif let == "t":
        nums[i][j] = 20
    elif let == "u":
        nums[i][j] = 21
    elif let == "v":
        nums[i][j] = 22
    elif let == "w":
        nums[i][j] = 23
    elif let == "x":
        nums[i][j] = 24
    elif let == "y":
        nums[i][j] = 25
    elif let == "z":
        nums[i][j] = 26

for i in range(N):
    for j in range(L):
        letter(letters[i][j])

letters = sorted(letters)

ans = ""

for i in range(N):
    for j in range(L):
       ans += letters[i][j]

print(ans)

Submission status: Accepted

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

ans = []

for _ in range(n):
    s = input()
    inserted = False
    for i, s2 in enumerate(ans):
        if s < s2:
            ans.insert(i, s)
            inserted = True
            break
    if not inserted:
        ans.append(s)

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import pdb
import sys
F = sys.stdin
N, L = F.readline().rstrip().split()
N = int(N)
L = int(L)
a = [F.readline().rstrip() for x in range(N)]

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