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

N = int(nl[0])
L = int(nl[1])

lst = []

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

lst.sort()

ans = ''

for s in lst:
   ans += s

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7

# import sys
# sys.stdout = open("e:/cp/output.txt","w")
# sys.stdin = open("e:/cp/input.txt","r")

n,l = map(int,input().split())
a = [input() for item in range(n)]
b = sorted(a)
print(''.join(b))

Submission status: Accepted

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

if __name__ == "__main__":
    N, L = map(int, input().split())
    si = []
    for i in range(N):
        si.append(str(input()))
    si.sort()
    print(''.join(si))

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を入力
N, L = map(int, input().split())


# 空のリストを生成
S = []

#入力
for i in  range(N):
    array = input()
    S.append(array)

#辞書順に並べ替え
S.sort()

#pythonのリストの出力では[と,が出力されるので取る
S=''.join(S)

#出力
print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n, l = map(int, input().split())
s = [0] * n
for i in range(n):
    s[i] = input().strip()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding:UTF-8
import sys


def resultSur97(x):
    return x % (10 ** 9 + 7)


if __name__ == '__main__':
    # ------ 入力 ------#
    nl = list(map(int, input().split()))     # スペース区切り連続数字

    x = nl[0]
    sList = [input() for _ in range(x)]

    # ------ 処理 ------#
    sListSorted = sorted(sList)
    out = ""
    for s in sListSorted:
        out += s

    # ------ 出力 ------#
    print("{}".format(out))
    # if flg == 0:
    #     print("YES")
    # else:
    #     print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

sortli=sorted(li)
print(''.join(sortli))

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

strList = []
for _ in range(0, n):
    strList.append(input())

strList.sort()

ans = ""
for i in range(0, n):
    ans += strList[i]

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:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
	N, L = map(int,input().split())
	di = list()
	for i in range(N):
		di.append(input())
	copy = sorted(di)
	ans =''.join(copy)
	print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans.sort()


print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush
import collections
import bisect

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

    array.sort()
    print(''.join(array))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N,L = inm()
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_i = [input() for i in range(N)]
m = ""
for x in sorted(S_i):
    m += x
else:
    print(m)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n,l = readInts()
s = [input() for _ in range(n)]
s = sorted(s)
print(''.join(map(str,s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def LI():
    return list(map(int, input().split()))


def LSH(h):
    return [input() for _ in range(h)]


N, L = LI()
S = LSH(N)
S.sort()
S = ''.join(S)
print(S)

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 = map(int, input().split())
d = [input() for _ in range(N)]
print("".join(sorted(d)))

Submission status: Accepted

Solution code:
_, _, *s = open(0).read().split()
print(''.join(sorted(s)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7





n,l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
result ="".join(s)
print(result)

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

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

Submission status: Accepted

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

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 = '')
print()

Submission status: Accepted

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

Submission status: Accepted

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

res.sort()

print(''.join(res))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n, l = [int(x) for x in input().split(' ')]
    S = [input() for i in range(0, n)]
    print(''.join(sorted(S)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

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

    s_list = [input().rstrip() for _ in range(n)]
    s_list = sorted(s_list)
    print("".join(s_list))


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, L: int, S: "List[str]"):
    return "".join(sorted(S))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(solve(N, L, S))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=[]

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

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

Submission status: Accepted

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

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

for i in range(N):
    D.append(input().strip())
D.sort()
print(''.join(D))

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, l = rm()
s = sorted([rr() for _ in range(n)])
print(*s, sep='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(sorted(x)))

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    N, L = input_int_list()
    S = []
    for _ in range(N):
        S.append(input())
    S = sorted(S)
    print("".join(S))

    return


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:
import sys
n,k = map(int, sys.stdin.readline().rstrip("\n").split())
l = [line.rstrip("\n") for line in sys.stdin]
l.sort()
s = ''.join(l)
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N, L = map(int, sys.stdin.readline().split())
S = []
for _ in range(N):
    S.append(sys.stdin.readline().strip())

S.sort()
ans = ""
for s_i in S:
    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(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

print(*s,sep="")

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

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

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

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:
n, l = map(int, input().split())
print(*sorted([input() for i in range(n)]), sep="")

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split(" ")))

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

l.sort()
print("".join(l))

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

arr.sort()
print("".join(arr))

Submission status: Accepted

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

for s in ss:
    print(s, end="")
print()

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = sorted(S)

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

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

l = sorted(data)
ans = ''

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

print(ans)

Submission status: Accepted

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

ans = ""
for i in range(len(S)):
    ans += S[i]
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

a, b= map(int,input().split())
table = []
ans = ""
for i in range(a):
    table.append(input())
list.sort(table)
for i in range(a):
    ans += table[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def find_where( List , word ):
    flag = 1
    for i , list_i in enumerate(List):
        if list_i > word:
            flag = 0
            break
    return i + flag

def main():
    n , l = map( int, input().split() )
    I = []
    for i in range(n):
        s = str(input())
        s = s[:-1]
        I.append( s )
    Ss = []
    Ss.append( I[0] )

    for i in range(1,n):
        s = I[i]
        where_i = find_where( Ss , s )


        Ss.insert( where_i , s )

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

main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
list = []
for i in range(a):
  list.append(input())
list1 = sorted(list)
for i in list1:
  print(i, end = "")

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
c=[input() for i in range(a)]
c.sort()
d=""
for k in range(a):
  d=d+c[k]
print(d)

Submission status: Accepted

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

Submission status: Accepted

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


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


main()

Submission status: Accepted

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

print("".join(sorted(str_list)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# bsdk idhar kya dekhne ko aaya hai, khud kr!!!
# import math
# from itertools import *
# import random
# import calendar
import datetime
# import webbrowser

# f = open("input.txt", 'r')
# g = open("output.txt", 'w')
# n, m = map(int, f.readline().split())

n, k = map(int, input().split())
arr = []
for i in range(n):
    arr.append(input())
arr.sort()
print("".join(arr))

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

for n in range(N):
  a = input()
  A.append(a)
  
A.sort()
print(''.join(A))

Submission status: Accepted

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

Submission status: Accepted

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

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

s.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = map(int, raw_input().split())
print ''.join(sorted([raw_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()
Ans=S[0]
for i in range(1,N):
    Ans+=S[i]
print(Ans)

Submission status: Accepted

Solution code:
N, L = [int(x) for x in input().split()]
S_list = []
for i in range(N):
    S_list.append(input())
    
S = ''.join(sorted(S_list))
print(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:
def main():
    n, _ = map(int, input().split())
    s = [input() for _ in range(n)]
    s.sort()
    print(''.join(s))


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

seq = []

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def compare_strings(s1, s2):
    if s1 < s2:
        return True
    return False

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

print(''.join(sorted(strings)))

Submission status: Accepted

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

S=sorted(S)
for j in range(N):
    ans+=S[j]
print(ans)

Submission status: Accepted

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

s.sort()

print(''.join(s))

Submission status: Accepted

Solution code:
nl = list(map(lambda x: int(x), input().split(" ")))
n = nl[0]
l = nl[1]

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

strs.sort()

print(''.join(strs))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

inp.sort()
ans=""
for i in range(N):
    ans+=inp[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()
b = ""
for i in a:
  b += i
print(b)

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

Submission status: Accepted

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

A.sort()

print(''.join(A))

Submission status: Accepted

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

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

for string in s:
    print(string, end='')

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b = m()

data = []

ans = ""

for i in range(a):
    data.append(input()[:-1])
data.sort()

for i in range(a):
    ans += data[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L = map(int,input().split())
str_list=[]
final_str = ""
for i in range(N):
    str_list.append(input())
new_list = sorted(str_list)
for n in range(N):
    final_str += new_list[n]
print(final_str)

Submission status: Accepted

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

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

lis.sort()

print(''.join(lis))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = [int(x) for x in input().split()]
s_list = []
for i in range(s[0]):
    s_list.append(input())

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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