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:


if __name__ == "__main__":
    n, l = map(int, input().split())
    words = []
    for i in range(n):
        words.append(input())
    words.sort()
    print("".join(words))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# At Beginner Contest 042 B (200)
n, l = map(int, input().split())
S = []
for _ in range(n):
    S.append(input())

out = []
min_ = float("inf")
min_idxs = list(range(len(S)))
pos = 0
while S:
    new_min = []
    for i in min_idxs:
        s = S[i]
        ch = ord(s[pos])
        if ch < min_:
            min_ = ord(s[pos])
            new_min = [ i ]
        elif ch == min_:
            new_min.append(i)
    if len(new_min) == 1 or pos == l - 1:
        for i in range(len(new_min)):
            out.append(S[new_min[i]])
        for i in range(len(new_min) - 1, -1, -1):
            del S[new_min[i]]
        min_idxs = list(range(len(S)))
        pos = 0
    else:
        pos += 1
        min_idxs = new_min
    min_ = float("inf")

r = "".join(out)
print(r)

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

Submission status: Accepted

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

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

a = sorted(string_list)

print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
class Heap:
    def __init__(self,nodes):
        self.nodes = nodes

    def buildHeap(self):
        for i in range(int(len(self.nodes)/2),-1,-1):
            self.siftDown(i)

    def siftDown(self,start):
        while (2*start+1 < len(self.nodes)):
            c = 2*start+1
            if (c+1 < len(self.nodes) and self.nodes[c+1] < self.nodes[c]):
                c += 1
            if (self.nodes[c] < self.nodes[start]):
                self.nodes[start], self.nodes[c] = self.nodes[c], self.nodes[start]
                start = c
            else:
                return

    def getMin(self):
        min = self.nodes[0]
        self.nodes[0] = self.nodes[-1]
        del(self.nodes[-1])
        self.siftDown(0)
        return min


nStr, strLen = map(int,input().split())
nodes = []
for i in range(nStr):
    nodes.append(input())

heap = Heap(nodes)
heap.buildHeap()

minStr = ''
for i in range(nStr):
    minStr += heap.getMin()

print(minStr)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,l = map(int,input().split())
s=["" for _ in range(n)]
for i in range(n):
    s[i]=str(input())
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:
s = input().rstrip().split(' ')
num = int(s[0])
list = []
for i in range(num):
	list.append(str(input()))
list.sort()
string = "".join(list)
print(string)

Submission status: Accepted

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

wordlist.sort()

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

print(word)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check(strings):
    return ''.join(sorted(strings))


def main():
    n, l = map(int, input().split())
    strings = []
    for i in range(n):
        strings.append(input())
    print(check(strings=strings))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n, l = list(map(int, input().rstrip('\n').split()))
    s = [str(input().rstrip('\n')) for _ in range(n)]
    s.sort()
    print("".join(s))


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
N, L = map(int, input().split())
s_list = []
for s in range(N):
    s_list.append(input().rstrip())

s_list = sorted(s_list)

line = ''
for s in s_list:
    line += s
print(line)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = [input() for 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,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
str_num, str_len = map(int, input().split())
strs = list(str(input()) for s in range(str_num))
strs.sort()
ans = "".join(strs)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(*sorted_list, sep = '')

Submission status: Accepted

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

list=[]
for i in range(N):
    string = input()
    list.append(string)
    
new_list = sorted(list)

st="".join(new_list)
print(st)

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

Submission status: Accepted

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

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

ans=sorted(string_list)

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

Submission status: Accepted

Solution code:
def _input():
    array = input().split()
    return int(array[0])

def input_str(number):
    array = []
    for i in range(number):
        array.append(input())
    return array

def answer(array):
    return ''.join(sorted(array))
    
if __name__ == "__main__":
    n = _input()
    array = input_str(n)
    print(answer(array))

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
temp_list = []
for i in range(n):
  temp_list.append(input())
ans_list = []
for temp_str in temp_list:
  if len(ans_list) == 0:
    ans_list.append(temp_str)
  else:
    max_flg = True
    for i in range(len(ans_list)):
      if temp_str <= ans_list[i]:
        ans_list.insert(i, temp_str)
        max_flg = False
        break
    if max_flg == True:
      ans_list.append(temp_str)
ans = ''.join(ans_list)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = map(int, input().split())
list = sorted([input() for i in range(n)])
print(*list, 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:
#2019/09/27
N, L = map(int, input().split())
S = [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 = []
for i in range(n):
    s.append([input()])
s = sorted(s)
ans = ''.join(sum(s, []))
print(ans)

Submission status: Accepted

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

words = [input() for _ in range(N)]

words.sort()

print(''.join(words))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L,*S = map(str,open(0).read().split())
S.sort()
print("".join(S))

Submission status: Accepted

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

S = list(range(N))

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

S.sort()

for i in range(N):
    print("%s" %S[i], end="")
print("")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力のNとLを読み取る
N, L = map(int, input().split())

#S1 ~ SNをリスト化
list_a = [input() for i in range(N)]

list_a.sort()

list_b = "".join(list_a)

print(list_b)

Submission status: Accepted

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

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

s.sort()
ans = ""
for ele in s:
    ans += ele

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

input_moji = input().split()
mojiretsu = int(input_moji[0])
mojikosuu = int(input_moji[1])
s=""

input_list = [input() for i in range(mojiretsu)]
input_list.sort()

for i in input_list:
    s = s+i
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(sorted(l)))

Submission status: Accepted

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

input_str_list = []
for input_str_index in range(N):
    input_str_list.append(input())

input_str_list.sort()

print(''.join(input_str_list))

Submission status: Accepted

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

input_str_list = []
for input_str_index in range(N):
    input_str_list.append(input())

input_str_list.sort()

print(''.join(input_str_list))

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

Submission status: Accepted

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

s = []

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

s.sort()

print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
	S.append(input())
S.sort()
for i in S:
	print(i,end="")

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:
def resolve():
    n, l = map(int, input().split())
    s = list(input() for _ in range(n))
    s.sort()
    print("".join(s))


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(n):
  s.append(input())
  
s.sort()
print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_n=input().split(" ")
N=int(input_n[0])
L=int(input_n[1])
say=[]
for i in range(N):
    say.append(input())
say.sort()
state=""
for i in range(N):
    state+=say[i]
print(state)

Submission status: Accepted

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

Submission status: Accepted

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

# 最速
# n, _ = map(int, input().split())
# a = sorted([input() for _ in [0]*n])
# print(*a, sep='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l=input().split();print("".join(sorted(eval("input(),"*int(n)))))

Submission status: Accepted

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

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

S.sort()

ans = ''

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def list_to_str(input_list):
    string = ""
    for i in input_list:
        string += i

    return string

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

print(list_to_str(sorted(s)))

Submission status: Accepted

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

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

data.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s.sort()

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

print("")

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

s.sort()

out = ''

for i in s:
    out += i

print(out)

Submission status: Accepted

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

words_sorted = sorted(words)
new_words = "".join(words_sorted)
print(new_words)

Submission status: Accepted

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

ans = Sn.pop(Sn.index(min(Sn)))
for i in range(N-1):
  ans+=Sn.pop(Sn.index(min(Sn)))
print(ans)

Submission status: Accepted

Solution code:
#coding: utf-8

n = list(map(int, input().split()))
s_list = []
for i in range(0, n[0]):
    s_list.append(input())
s_list = sorted(s_list)

s = ""
for i in range (0, len(s_list)):
    s += s_list[i]

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

Submission status: Accepted

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

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

ans = ''
for i in range(N):
  ans += S[i]
  
print(ans)

Submission status: Accepted

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

S.sort()

print("".join(S))

Submission status: Accepted

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

c = sorted(s)
ans =''.join(c)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# print(N)
# print(L)

lst = []

for i in range(N):
    # print(i)
    S = input()
    # print(S)
    lst.append(S)
    
lst.sort()
# print(lst)
print(''.join(lst))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

s.sort()
print(''.join(s))

Submission status: Accepted

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

s = ""
for i in range(N):
  temp = min(Li)
  Li.remove(temp)
  s += temp
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, L = ISI()
a = ""
s = sorted([IS() for _ in range(N)])
for i in range(N):
    a += "".join(s[i])
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N, L = map(int, input().split())
    S = []
    for i in range(N):
        S.append(input())
    S.sort()
    t = ""
    for S_i in S:
        t += S_i
    
    print(t)

Submission status: Accepted

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

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

words.sort()
print("".join(words))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

num = [int(z) for z in n ] 
f = num[0]
s = num[1]

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

s_words = sorted(words)

j_s_words = "".join(s_words)
print(j_s_words)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,L=map(int,input().split())

list=sorted([input() for i in range(N)])
print(*list,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n, l = na()
li = [input() for i in range(n)]
li.sort()
print("".join(li))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
x=input()
x=x.split(' ')
y=[]
for i in range(int(x[0])):
    y.append(input())

y.sort()
print(''.join(y))

Submission status: Accepted

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

s = [list(map(str,input().split())) for i in range(m[0])]
a=''
s.sort()
for i in range(m[0]):
  a=a+''.join(s[i]) 
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a_list=[]
N, L = map(int, input().split())
for a in range (N):
    a_list.append(input())
    
new_list=sorted(a_list)
string=""
for word in new_list:
    string+=str(word)
print(string)

Submission status: Accepted

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

Submission status: Accepted

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

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())
S=list(input() for _ in range(n))
S.sort()
for j in S:
    print(j, end="")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

str.sort()

print(''.join(str))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    test()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  n, m = [int(x) for x in raw_input().split(' ')]
  strs = [raw_input() for x in xrange(n)]
  print(''.join(sorted(strs)))

main()

Submission status: Accepted

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

print(''.join(sorted([input() for i in range(n)])))