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

out=""
for i in lis:
  out+=i
  
print(out)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

g = sorted(s)

print(''.join(g))

Submission status: Accepted

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

Submission status: Accepted

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

a = [[] * l for i in range(n)]
for i in range(n):
    I = input()
    for j in range(l):
        a[i].append(I[j])
# print(a)
b = a
for i in range(l-1,-1,-1):
    b = sorted(b, key=lambda x: x[i])

ans = []
for i in range(n):
    ans.append("".join(b[i]))
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
x=[int(i) for i in input().split()]
v=[]
for i in range(x[0]):
    string=str(input())
    v.append(string)
v.sort()
c=''
for ele in v:
    c+=ele
print(c)

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):
    print(s[i],end="")

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

ans = ""
arr = []

for i in range(0, N):
  temp = str(input())
  arr.append(temp)
arr = sorted(arr)

for i in range(0,N):
  ans = ans + arr[i]

print(ans)

Submission status: Accepted

Solution code:
def swap(s, t) :
  for i in range(L) : 
    if (s[i] < t[i]) : 
      return True
    elif (s[i] > t[i]) :
      return False
  return True

def strsort(s) : 
  for i in range(N) : 
    j = N - 1
    while j > i :
      if swap(s[j], s[j - 1]) : 
        tmp = s[j - 1]
        s[j - 1] = s[j]
        s[j] = tmp
      j -= 1


str = input()
lis = str.split(" ")
N = int(lis[0])
L = int(lis[1])
s = list()

for i in range(N) :
  s.append(input())
  
strsort(s)

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

word_list = []

for i in range(int(n[0])):
    word_list.append(input())

sorted_list = sorted(word_list)
answer = "".join(sorted_list)
print(answer)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def read_a_int(): return int(read())


def read_ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
# https://atcoder.jp/contests/abc042/tasks/abc042_b

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

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

Submission status: Accepted

Solution code:
import itertools

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

s = [list(input()) for x in range(N)]

s.sort()

print("".join(list(itertools.chain.from_iterable(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 = list(map(int, input().split()))
S = []
for _ in range(N):
    S += [input()]
print(''.join(sorted(S)))

Submission status: Accepted

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

Submission status: Accepted

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

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

L = list([input() for i in range(n)])
L.sort()
word = ""

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

print(word)

Submission status: Accepted

Solution code:
n, m = 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)]

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

Submission status: Accepted

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

    s_list.sort()
    ans = ''.join(s_list)
    print(ans)

main()

Submission status: Accepted

Solution code:
n,l=map(int,input().split())
s=[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())
a=list(input() for i in range(N))
b=sorted(a)
c=''.join(b)
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

b=''
for i in range(n):
  b+=n_s[i]

print(b)

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

sorted_S = sorted(S)

print(*sorted_S,sep='')

Submission status: Accepted

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

print(*S, sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sorted_S = sorted(S)

for i in sorted_S:
    print(i,end='')

Submission status: Accepted

Solution code:
class A:

    def solve(self):
        [a, b, c] = sorted([int(x) for x in input().split(" ")])
        if a == 5 and b == 5 and c == 7:
            print("YES")
        else:
            print("NO")

class B:

    def solve(self):
        [n, l] = [int(x) for x in input().split(" ")]

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

        sorted_strings = sorted(strings)

        print("".join(sorted_strings))

B().solve()

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= input().split()
n = int(n)
list = []
ans = ""
for i in range(n):
    list.append(input())
list.sort()
for i in list:
    ans = ans + i
print(ans)

Submission status: Accepted

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

for i in range(N):
    A = input()
    a.append(A)

a.sort()
print("".join(a))

Submission status: Accepted

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

S = []
for _ in range(N):
  S.append( input() )
 
sd =  sorted(S, key=lambda x: (str(x)[0], x))

print("".join(sd))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N, L = [int(x) for x in stdin.readline().rstrip().split()]

data = [stdin.readline().rstrip().split() for _ in range(N)]

flat = [flatten for inner in data for flatten in inner]
flat.sort()

print(''.join(flat))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, L =list(map(int, input().split()))
array = []
word = ""
for i in range(N):
    s = input()
    array.append(s)
new_array = sorted(array)    
for j in range(N):
    word += new_array[j]
print(word)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *
 
N, L = MAP()
S = [input() for _ in range(N)]
S.sort()
print("".join(S))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

N, L = MAP()
S = [input() for _ in range(N)]
S.sort()
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n, l = map(int, input().split())
    s = [input() for i in range(n)]
    ss = sorted(s)
    res = ''
    for i in ss:
        res = res + i
    print(res)
if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

slist=[]
for _ in range(N):
  slist.append(input())
slist.sort()
print("".join(slist))

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
M=[0]*N
for i in range(N):
  M[i]=str(input())
M.sort()
ans=''
for i in range(N):
  ans+=M[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:
count , low = map(int, input().split(" "))
li = sorted([input() for s in range(count)])

print(''.join(li))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B - 文字列大好きいろはちゃんイージー
# https://atcoder.jp/contests/abc042/tasks/abc042_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()) #指定された数の文字列を受け取る
s=sorted([input() for i in range(n)])#s[i]にn回分文字列を代入する。さらにその後ソートをする。勝手に辞書順になる

print(*s,sep="")#sの中のすべての文字列を表示。この時""で表示

Submission status: Accepted

Solution code:
import sys
import bisect
import heapq

sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline

def main():
    n,l = map(int,read().split())
    li = []
    for i in range(n):
        li.append(input())
    li.sort()
    for s in li:
        print(s,end="")
    print()

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N, L = map(int, input().split())
    S = [input().strip("\n") for _ in range(N)]
    S.sort()
    print("".join(S))
   
    
    return 0

if __name__ == "__main__":
    solve()

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

Submission status: Accepted

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

S.sort()

ans = ''
for Si in S:
    ans += Si

print(ans)

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

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

print (''.join(S))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

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

Submission status: Accepted

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

n, l = [int(x) for x in input().split()]

s = [input().rstrip() 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()
print("".join(s))

Submission status: Accepted

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

list = []

for i in range(n):
    list.append("{}".format(input()))

list.sort()

for i2 in range(n):
    print(list[i2],end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7

N, L = MAP()
S = [input() for _ in range(N)]

S.sort()
ans = str()

for x in S:
	ans += x

print(ans)

Submission status: Accepted

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

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=ans+i
print(ans)

Submission status: Accepted

Solution code:
#! python3

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

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n, l = LI()
s = SR(n)
s.sort()
print(''.join(s))

Submission status: Accepted

Solution code:
## B - 文字列大好きいろはちゃんイージー
N, L = map(int, input().split())
print(''.join(sorted([input() for s in range(N)])))

Submission status: Accepted

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

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

Submission status: Accepted

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

"""
Lの文字列N個(s1-sN)
N個の文字列を辞書順にしたあと，くっつけて出力する
"""


def main():
    n, l = map(int, input().split())
    input_list = []

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

    result_list = sorted(input_list)
    print("".join(result_list))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(*s, sep='')

Submission status: Accepted

Solution code:
a=input().split(" ")
list1=[]
c=""


for i in range(int(a[0])):
	b=input()
	list1.append(b)

list2=sorted(list1)

for j in range(int(a[0])):
    c=c+list2[j]

print(c)

Submission status: Accepted

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

for j in s:
    result = result + j

print(result)

Submission status: Accepted

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

for j in s:
    result = result + j

print(result)

Submission status: Accepted

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

S = sorted(S)

print("".join(S))

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

N = l[0]
L = l[1]

s = [input() for i in range(N)]
result = ""
for i in sorted(s):
  result += i
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Iloha = []

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

Iloha.sort()

print("".join(Iloha))

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

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

iroha.sort()
print(''.join(iroha))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N, L = invr()

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

res = ""
for i in A:
    res += i
print(res)

Submission status: Accepted

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

f01()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n, l = LI()
s = SR(n)
s.sort()
print(''.join(s))

Submission status: Accepted

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

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

# ソート
l.sort()

# 出力
print(''.join(l))

Submission status: Accepted

Solution code:
N, L = input().split(' ')
N = int(N)
L = int(L)
a = []

for i in range(N):
  a.append(input().rstrip())

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

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

Submission status: Accepted

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

print(A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

n,l = imap()
s = []
for i in range(n): s.append(sinput())

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

Submission status: Accepted

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

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 f  in range(n)]
string = sorted(s)
print("".join(string))

Submission status: Accepted

Solution code:
n, l = list(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())
A = [0]*N
for i in range(N):
  A[i] = input()
B = sorted(A)
for i in range(N):
  print(B[i], end = "")

Submission status: Accepted

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