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:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,L=MI()
    S=[ST() for _ in range(N)]
    S.sort()
    print(*S,sep="")
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())
lst = [input() for _ in range(N)]
lst.sort()
print(''.join(lst))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

S = []
for s in range(0, N):
    S.append(input())
S.sort()

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

for word in words:
  print(word,end='')

Submission status: Accepted

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

Submission status: Accepted

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

sl = [input() for i in range(n)]
sl.sort()
print("".join(sl))

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:
try:
  N, L = map(int, input().split())
  l = []
  for i in range(N):
      l.append(input())
  l_ = sorted(l)
  print(''.join(l_))
except EOFError:
  pass

Submission status: Accepted

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

Submission status: Accepted

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

S1 = sorted(S)

S2 ="".join(S1)

print(S2)

Submission status: Accepted

Solution code:
# 入力 : 縦並びの数字N個
N, L = map(int, input().split())
list_A = [0 for i in range(0,N)]
for i in range(0,N) :
    list_A[i] = input()

list_A.sort()
ans = "".join(list_A)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

s_lst.sort()

print(''.join(s_lst))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def hikaku(n1, n2):
    for x, y in zip(n1, n2):
        if ord(x) == ord(y):
            continue
        else:
            return True if ord(x) > ord(y) else False
num, length = map(int, input().split())
wlist = []
for i in range(num):
    wlist.append(input())
for n in range(num - 1):
    kumi = [(x, x+1) for x in range(num - 1 - n)]
    if kumi:
        for x, y in kumi:
            if hikaku(wlist[x], wlist[y]):
                wlist[x], wlist[y] = wlist[y], wlist[x]
dst = ""
for w in wlist:
    dst += w
print(dst)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a=[]

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

a=sorted(a)

print("".join(a))

Submission status: Accepted

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

s = [input() for t 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):
    a.append(input())
a=sorted(a)
print("".join(a))

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

S.sort()
print("".join(S))
# 文字列にもsortが使える。デフォルトでは辞書順で昇順となる
# [dxx,axx,cxx]⇒[axx,cxx,dxx]

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:
# coding: utf-8
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.append(input())
print(''.join(sorted(data)))

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
S=[input() for n in range(N)]
S=sorted(S)
"""for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
                break
"""
print("".join(S))

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
import itertools

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, L = map(int, readline().split())
S = read().decode('utf8').split()

S.sort()

print(*S,sep='')

Submission status: Accepted

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

words = []

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

print("".join(sorted(words)))

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
list = []
for x in range(n):
    list.append(input())
else: list.sort()
answer = ""
for id in range(n):
    answer += list[id]
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

N,L = map(int, input().split())
s = [input() for _ in range(N)]
t = sorted(s)
print(''.join(t))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# cook your dish here
s=input()
m=s.split()
n=int(m[0]);
l=int(m[1]);

list=[]
for i in range(n):
    st=input()
    list.append(st)
list.sort()
for i in list:
    print(i,end="")

Submission status: Accepted

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

s = []

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

s.sort()

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

Submission status: Accepted

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

a.sort()
ans=''
for i in a:
	ans+=i
print(ans)

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 042
# B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
N, L = map(int, input().split())
S = ['' for i in range(N)]
for i in range(N):
    S[i] = input()
S.sort()
for i in range(N):
    print(S[i], end='')
print('')

Submission status: Accepted

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

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

str = ''.join(S)

print(str)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = sorted(S)

print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

#n, a, b= map(int, input().split())
n, l  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
#n = int(input())
a = [""]*n
for i in range(n):
  a[i] = str(input())

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

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

sss.sort()

print("".join(sss))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

lines = sys.stdin.readlines()
lines = np.array(lines[1:]).flatten()
lines = [ l.replace("\n", "") for l in lines ]
lines = np.sort(lines)

s = ""
for l in lines:
  s += l
print(s)

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
S = [input() for _ in range(N)]
S.sort()
for _ in range(N):
  print(S[_], 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:
in_len = input().split(" ")
in_n = int(in_len[0])
in_l = int(in_len[1])
in_s = []

for i in range(in_n):
  in_s.append(input())

srt = sorted(in_s)
print("".join(srt))

Submission status: Accepted

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

Submission status: Accepted

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

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

list.sort()
print("".join(list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getInput():
    return [i for i in input().rstrip().split(' ')]

N, L = map(int, getInput());
lst = []
for i in range(N):
    lst.append(getInput()[0])

lst.sort()
print(''.join(lst))

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:
import sys

# N L 文字列数と文字列長
n, l = map(int, input().split())

s = []

# S1, S2 ... Sn
for i in range(n):
    s.append(input())

# ソート
s.sort()

# 要素を連結
print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
def S_():
    return input()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
YN=['Yes','No']
inf=float('inf')
input=lambda: sys.stdin.readline().rstrip()

ans=1

a=[]
n,l=LI()
for i in ' '*n:
    a.append(input())

print(''.join(sorted(a)))

Submission status: Accepted

Solution code:
N,K = map(int, input().split())
lst = []
for z in range(N):
    lst.append(input())
lst.sort()
print("".join(lst))

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

lo = ""
for i in li:
    lo += i
    
print(lo)

Submission status: Accepted

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

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

Submission status: Accepted

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

res = ''
for c in sorted(chars):
	res += c
    
print(res)

Submission status: Accepted

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

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

for i, a in enumerate(Ss):
  key = a
  j = i - 1

  while j >= 0 and Ss[j] > a:
    Ss[j + 1] = Ss[j]
    j = j - 1

  Ss[j + 1] = key

print(''.join(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):
    if i == n - 1:
        print(s[i])
    else:
        print(s[i], end="")

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:
def order_sentence(args_num, arg_sentence_length, args_list):
    ordered_sentence = "".join(sorted(args_list))
    return ordered_sentence

if __name__=='__main__':
    args_num, arg_sentence_length = map(int, input().split())
    args_list = [input() for i in range(args_num)]
    print(order_sentence(args_num, arg_sentence_length, args_list))

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:
if __name__ == '__main__':
	Ss = []
	N, L = map(int, input().split())
	for i in range(0,N):
		Ss.append(input())

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

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 = []
ans = ""

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

L = sorted(S)

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

print(ans)

Submission status: Accepted

Solution code:
N, L = map(int, input().split())
strs = [[]] * N
for i in range(N):
  strs[i] = str(input())
strs.sort()
x = strs[0]
for j in range(1,N):
   x += strs[j]
print(x)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = sorted(list(input() for i in range(a)))
print("".join(c))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=list(input() for _ in range(a))
c.sort()
print("".join(c))

Submission status: Accepted

Solution code:
#042c
N,L = map(int, input().split())
S_list = []

for i in range(N):
  S = str(input())
  S_list.append(S)
  
S_list.sort(reverse=False)

#print(S_list)
print(''.join(map(str,S_list)))

Submission status: Accepted

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

Submission status: Accepted

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

alist = []

for i in range(N):
    alist.append(input())
 
blist = []
blist = sorted(alist)
ans = "".join(blist)

print(ans)

Submission status: Accepted

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

s = [str(input()) for i in range(N)]
p = sorted(s)
print("".join(p))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
NL = input().split()
N = int(NL[0])
strList = []
for i in range(N):
    strList.append(input())
strList.sort()
strLong = ''
for i in range(N):
    strLong += strList[i]
print(strLong)

Submission status: Accepted

Solution code:
N, K = [int(x) for x in input().split()]
a = []
for _ in range(N):
  a.append(input())
a.sort()
print(''.join(a))

Submission status: Accepted

Solution code:
inputs = input().split(' ')
n, l = int(inputs[0]), int(inputs[1])
s_n = [input()for i in range(n)]
print(('').join(sorted(s_n)))

Submission status: Accepted

Solution code:
ss = []

n, l = list(map(int, input().split()))
for _ in range(n):
  ss.append(input())
  
ss.sort()

print("".join(ss))

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,l=INTM()
    s=[]
    for i in range(n):
        s.append(STR())
    s.sort()
    print(*s,sep='')
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
a = input().split()
n= a[0]
l = a[1]
s = []
for i in range(int(n)):
    s.append(input())

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

print(ret)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import os

if __name__ == "__main__":
    temp = input().split(" ")
    N = int(temp[0])
    L = int(temp[1])
    S = [0]*N
    for i in range(0, N):
        S[i] = input()
    S.sort()
    print("".join(S))

Submission status: Accepted

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

S.sort()
s = []

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

print("".join(s))

Submission status: Accepted

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

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

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

print(''.join(sorted(chars)))

Submission status: Accepted

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

Submission status: Accepted

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

N, L = list(map(int, input().split()))
s_list = []

for _ in range(N):
    s = input()
    s_list.append(s)
ans = "".join(sorted(s_list))

print(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())
S=list(input() for i in range(N))
S.sort()
print(*S,sep="")

Submission status: Accepted

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

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 _ in range(n)]

ans = ""

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N, L = [int(x) for x in input().split()]
S = []
for _ in range(N):
    S.append(input().rstrip())
S.sort()
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

list = sorted(list)

print(''.join(list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_map = []
string_num, string_length = map(int, input().split())
for i in range(string_num):
    input_line = input()
    input_map.append(input_line)

input_map.sort()

line = ""
for i in range(string_num):
    line = line + input_map[i]

print(line)

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

Submission status: Accepted

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

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

s = sorted(s)

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
n,l=map(int,input().split())
S=sorted(list(input() for _ in range(n)))
for s in S:
    print(s,end='')
print()

Submission status: Accepted

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

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

li.sort()
print("".join(li))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n,k = map(int, input().split())
sl = [input() for _ in range(n)]

sl.sort()
print("".join(sl))

Submission status: Accepted

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

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

ans = ''
for s in sorted(S):
  ans += s

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, L = list(map(int, input().split()))
S = [ input() for n 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())
for i in range(n - 1):
    for j in range(i + 1, n):
        if len(s[j]) < len(s[i]) and s[i] == s[j]:
            s[i], s[j] = s[j], s[i]
        else:
            for k in range(min(len(s[i]), len(s[j]))):
                if ord(s[i][k]) > ord(s[j][k]):
                    if s[i][:k] == s[j][:k]:
                        s[i], s[j] = s[j], s[i]
print(*s, sep="")

Submission status: Accepted

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

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

#文字列比較は辞書順となる
sASorted = sorted(sArray)
#''.joinはリスト要素に格納された文字列の結合をすっきり書くことができる
result = ''.join(sASorted)

print(result)