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 = [[""]*l for syoki in [""]*n]
flag = [["ok"]*l for syoki in ["ok"]*n]
dummy = ""
#print(s)
for i in range(n):
  dummy = input()
  count = 0
  for q in dummy:
    s[i][count] = q
    count = count + 1

#文字列判定
for j in range(n):
  for k in range(n-1):
    for m in range(l):
      if s[j][m] < s[k][m]:
        dummy = s[j]
        s[j] = s[k]
        s[k] = dummy
        break
      elif s[j][m] > s[k][m]:
        break
out = ""  
for f in range(n):
  for g in range(l):
    out = out + s[f][g]
print(out)

Submission status: Accepted

Solution code:
#s長さ一定なのでソートでよい
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())

ans = []

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

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

Submission status: Accepted

Solution code:
#B
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())
l = [input() for i in range(N)]
l.sort()
for m in range(N):
  print(l[m],end="")

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
n,m = map(int,readline().split())
lst1 = []
for i in range(n):
    lst1.append(readline().rstrip().decode('utf-8'))

lst1.sort()

print("".join(lst1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

S.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = list(map(int,input().split()))
word = [input() for i in range(num[0])]
print(''.join(sorted(word)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a.sort()

for i in range(num):
  print(a[i], end="")
print()

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

Submission status: Accepted

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

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

s = sorted(s)

sj = ''
for i in range(n):
    sj += s[i]

print(sj)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,(input().split()))
li=[]
for i in range(a):
    li.append(input())
li2=sorted(li)
c=li2[0]
for j in range(1,a):
    c+=li2[j]
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s.sort()

ans = ""

for v in s:
    ans += v

print(ans)

Submission status: Accepted

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

    for i in sorted(S):
        print(*i,sep='',end='')
    print()


resolve()

Submission status: Accepted

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

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:
import sys
n, l = map(int, input().split(" "))
lis = sys.stdin.readlines()
lis.sort()
for i in lis:
    print(i.rstrip(), end = '')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

#print(''.join(s)) こっちでも可

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(sorted(x)))

Submission status: Accepted

Solution code:
line = input().split(' ')
N = int(line[0])
L = int(line[1])
List = []
for i in range(N):
  List.append(input())
List.sort()
for i in List:
  print(i,end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
dic={}
for i in range(n):
    text=input()
    if text[0] not in dic:
        dic[text[0]]=[text]
    else:
        dic[text[0]].append(text)
for i in dic:
    dic[i]=sorted(dic[i])
dic=sorted(dic.values())
for i in dic:
    try:
        for j in i:
            print(j,end='')
    except:
        print(i,end='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(map(int, input().split()))
s = [input() for i in range(N)]
s.sort()
result = ''
for i in range(N):
    result += s[i]
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = map(int, input().split())
Li = []
i = 0
while i<n:
  Li.append("".join(input()))
  i += 1
else:
  Li.sort()
  print("".join(Li))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n, l = map(int, input().split(' '))
s = [input().rstrip('\r\n') for _ in range(n)]
s.sort()
print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input().split()
N = int(n[0])
L = int(n[1])
a = []
for i in range(N):
    b = input()
    a.append(b)
A = sorted(a)
print(''.join(A))

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

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

Submission status: Accepted

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

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

res = ""
for i in range(n):
    res += min(lst)
    lst.remove(min(lst))

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(input() for _ in range(N))
S.sort()
print("".join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

    S.sort()
    print("".join(S))
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, l = map(int,input().split())
s = []
for i in range(n):
    s.append(str(input()))

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

Submission status: Accepted

Solution code:
def main():
    N, K = (int(i) for i in input().split())
    A = [input() for i in range(N)]
    A.sort()
    print("".join(A))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(*S,sep="")

Submission status: Accepted

Solution code:
n, l, *s = open(0).read().split()
print("".join(sorted(s)))

Submission status: Accepted

Solution code:
I=input().split()
N=int(I[0])
L=int(I[1])
s=[]
for _ in range(N):
  s.append(input())
s.sort()
all=""
for i in s:
  all+=i
  
print(all)

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, L = list(map(int, sys.stdin.readline().split()))
    S = sorted([line.rstrip() for line in sys.stdin.readlines()])
    print(*S, sep="")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B  2020/03/01 14:38-
n, l = map(int, input().split())
s = []
for i in range(n):
    S = input()
    s.append(S)
    
s.sort()
for j in s:
    print(j, end='')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from struct import *

def fun(dct): 
    print(*dct)

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

dct = sorted(S)

for a in dct:
    print(*a, 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:
import sys, math

def input():
    return sys.stdin.readline()[:-1]

def main():
    N, L = map(int,input().split())
    S = [input() for k in range(N)]
    print("".join(sorted(S)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
#042_B
n,l=map(int,input().split())
s=[input() for _ in range(n)]
s.sort()
print(*s,sep='')

Submission status: Accepted

Solution code:
#042_B
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())
Li = []
for i in range(N):
    s = input()
    Li.append(s)
Ls = sorted(Li)
S = ''.join(Ls)
print(S)

Submission status: Accepted

Solution code:
def main():
    string_num, length = map(int, input().split())
    strings = [input() for _ in range(string_num)]
    strings.sort()
    print("".join(strings))


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

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

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
# coding:utf-8

(n,l) = [int(i) for i in input().rstrip().split(" ")]
list = sorted([input().rstrip() for i in range(n)])
print("".join(list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
if __name__ == '__main__':
    N,L= map(int, input().split())
    data=[]
    moji=''
    for i in range(N):
        data.append(input())
    data.sort()
    print(''.join(data))

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

Submission status: Accepted

Solution code:
N,L=input().split()
dic=list()
ans=""
for i in range(int(N)):
    s=input()
    dic.append(s)
dic=sorted(dic)
for c in dic:
    ans=ans+c;
print(ans)

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	a, c = IN()
	ss = [input() for _ in range(a)]
	ss.sort()
	ret = ''.join(ss)
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

s = ''
for i in S:
    s+=i
    
print(s)

Submission status: Accepted

Solution code:
import sys
readline = lambda:sys.stdin.readline().rstrip()
N,L = map(int, readline().split())
ss = [readline() for _ in range(N)]
ss.sort()
ans = ''.join(ss)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(''.join(sorted(ss)))

Submission status: Accepted

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

Submission status: Accepted

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

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

c = []
for _ in range(0, a[0]):
    c.append(input())

d = sorted(c)
ans = ''.join(d)

print(ans)

Submission status: Accepted

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

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

strings.sort()

print("".join(strings))

Submission status: Accepted

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

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 = 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()) #mapでリストに関数を適用する
A = []#配列用意
for i in range(N):
    A.append(input()) #Nこの文字列を読み込み　行列
A.sort() #ソートする
ans = "" #文字列の変数用意
for i in range(N):
    ans += A[i]#変数に代入していく
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s = [input() for i in range(int(a[0]))]
b = ''

s.sort()

b = ''.join(s)

print(b)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

#input S1 ~ SN as list S
S = [input() for _ in range(N)]

#辞書順にソート
S.sort()

#文字列を結合
str = ''.join(S)

print(str)

Submission status: Accepted

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

Submission status: Accepted

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

s.sort()
for i in range(n):
    a=''.join(s)
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, L = list(map(int,input().split()))
li = sorted([input() for i in range(X)])
ans = ''

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

Submission status: Accepted

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


#----------
n,l = list(map(int, input().rstrip().split()))
s_list = [input().strip() for _ in range(n)]
#----------
s_list.sort()
print("".join(s_list))

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 (0, N):
	S.append(input())

S_ans = sorted(S)

print(''.join(S_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:
#ABC042

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

lst = []

for i in range(1,N+1):
	lst.append(input())
  
lst.sort()

print("".join(lst))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

S.sort()

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

print()

Submission status: Accepted

Solution code:
def getlist():
    return list(map(int, input().split()))
  
a,b = getlist()
lis = []
for i in range(a):
  lis.append(input().strip())
  
lis.sort()
print("".join(lis))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

word.sort()
print(''.join(_ for _ in word))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N-1):
  A += S[i+1]
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="")

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(*sorted([input() for i in range(n)]),sep="")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, L = map(int, input().split())
s = [input()[: -1] for _ in range(N)]
s.sort()
print("".join(s))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, l = map(int,input().split())
s = []
for i in range(n):
    s.append(str(input()))

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