Problem:


Score : 200 points

Problem Statement

Iroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L.

She will concatenate all of the strings in some order, to produce a long string.

Among all strings that she can produce in this way, find the lexicographically smallest one.

Here, a string s=s_1s_2s_3...s_n is lexicographically smaller than another string t=t_1t_2t_3...t_m if and only if one of the following holds:

There exists an index i(1≦i≦min(n,m)), such that s_j = t_j for all indices j(1≦j<i), and s_i<t_i.

s_i = t_i for all integers i(1≦i≦min(n,m)), and n<m.

Constraints

1 ≦ N, L ≦ 100

For each i, the length of S_i equals L.

For each i, S_i consists of lowercase letters.

Input

The input is given from Standard Input in the following format:

N L
S_1
S_2
:
S_N

Output

Print the lexicographically smallest string that Iroha can produce.

Sample Input 1

3 3
dxx
axx
cxx

Sample Output 1

axxcxxdxx

The following order should be used: axx, cxx, dxx.



Sample input:
3 3
dxx
axx
cxx


Sample output:
axxcxxdxx

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = list(map(int, input().split()))
strings = [input() for _ in range(data[0])]
strings.sort()
s = ''
for x in strings:
    s += x
print(s)

Submission status: Accepted

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

moji=[]

for i in range(0,N):
    moji.append(input())
    
moji=sorted(moji)
answer=""

for i in range(0,N):
    answer+=moji[i]
    
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(S))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n,l = map(int, input().split())
a=[]
for i in range(0,n):
  a.append(input())
a.sort()
print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N, L = map(int, input().split())
words = []
answer = ''

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

for i in range(len(words)):
    word = min(words)
    answer += word
    words.remove(word)

print(answer)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, L = map(int, input().split())
# 複数行に複数の入力値を取得し、出力する
S = [input() for i in range(N)]
S = sorted(S)
# 出力
# リストSの各要素に対してlen()を取得したリストの各要素がすべてLと一致するか否かの判定
len_list = [s_length == L for s_length in list(map(lambda s: len(s), S))]
S_concat = ""
if all(len_list):
  for i in range(len(S)):
    S_concat+=S[i]
  print(S_concat)

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    n = next_int()
    l = next_int()

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

    print("".join(s))


def next_int():
    return int(next_str())


def next_str():
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

ans=""
for j in range(N):
    ans=ans+list1[j]
print("".join(list1))

Submission status: Accepted

Solution code:
a = input().split(" ")
ar = []
for j in range(int(a[0])):
    l = input()
    ar.append(l)
b = sorted(ar)
print("".join(b))

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#! /usr/bin/python3
# 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)

"""
    1≦N,L≦100
    全ての i(1≦i≦N) に対し、Si の長さは L に等しい。
    各 i について, Si は全て半角英小文字のみから成る文字列である。
"""

test_mode = False

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

if test_mode:
    print(S)
S.sort()
if test_mode:
    print(S)

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

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:
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:
# -*- coding: utf-8 -*-
from sys import stdin

N, L = [int(x) for x in stdin.readline().rstrip().split()]
dic = []

for i in range(N):
    dic.append(stdin.readline().rstrip())
    
dic_sort = sorted(dic)
ans = "".join(dic_sort)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

s.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_list = list(map(int, input().split()))
n = input_list[0]
l = input_list[1]
str_list = []

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

str_list = sorted(str_list)
ans_str = ''.join(str_list)
print(ans_str)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = map(int,input().split())
a = []
for _ in [0]*n:
  a += [input()]
a.sort()
print("".join(a))

Submission status: Accepted

Solution code:
num, length = map(int, input().split(" "))
li = [input() for x in range(num)]
li_sort = []

def q_sort(li):
    left = []
    right = []
    if len(li) <= 1:
        return li
    
    ref = li[0]
    ref_count = 0

    for ele in li:
        if ele < ref:
            left.append(ele)
        elif ele > ref:
            right.append(ele)
        else:
            ref_count += 1
    left = q_sort(left)
    right = q_sort(right)
    return left + [ref] * ref_count + right
print("".join(q_sort(li)))

Submission status: Accepted

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

log.sort()
result = ''

for i in log:
    result += i

print(result)

Submission status: Accepted

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

s = []

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

s.sort()

ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
n, l = map(int, input().split())
list_count = 0
list = []
while list_count < n:
  list.append(str(input()))
  list_count += 1
list.sort()
ans = ""
for letter in list:
  ans += letter
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

c = [0]*n
for i in range(n):
    c[i] = input()

c.sort()

print(*c,sep='')

Submission status: Accepted

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

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

print("".join(x))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input()
print(''.join( sorted([x.rstrip() for x in sys.stdin.readlines()])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

n, L = [int(i) for i in input().split()]
s = [input() for i in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

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

orderd_inputs = sorted(inputs)

print(''.join(orderd_inputs))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    s_list.append(input())
s_list.sort()

for st in s_list:
    print(st,end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input().split()[0])
a = []
for i in range(n):
    a.append(raw_input())
a.sort()
ans = ''
for i in a:
    ans += i;
print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    n, l = map(int, input().split())
    lists = [input() for _ in range(n)]
    # for _ in range(l):
    #     lists.append(input())
    lists = sorted(lists)
    for s in lists:
        print(s, end="")
    

solve()

Submission status: Accepted

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


import string
ALPHABETS = string.ascii_uppercase

def chars_to_int(chars):

    chars = chars.upper()
    size = len(chars)

    result = 0
    for pos, c in enumerate(chars):
        i = ALPHABETS.index(c) + 1
        exp = size - pos - 1
        result += i * 26 ** exp

    return result

a = []
for i in range(n):
    b = chars_to_int(s[i])
    a.append([b, s[i]])

a.sort(key=lambda x: x[0])

ans = ""
for i in range(n):
    ans += a[i][1]

print(ans)

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

S.sort()
for m in S:
	print(m,end="")
print()

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    n, l = map(int, input().split())
    arry = [input() for _ in range(n)]
    arry.sort()
    print(''.join(arry))

if __name__ == '__main__':
    main()

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:
num,lengh = map(int,input().split())
lis = [input() for i in range(num)]
print("".join(sorted(lis)))

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

for str in strList:
    print(str,end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    t = input().split(" ")
    N, L = int(t[0]), int(t[1])

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


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

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

Submission status: Accepted

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

k=[]

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

print(''.join(k))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

L = []
for i in range(N):
    S = input()
    L.append(S)
    
sorted_L = sorted(L)
print("".join(sorted_L))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = ''
for ss in sorted(s):
    ans += ss
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

li.sort()

ans = ''

for s in li:
	ans = ans + s
	
print(ans)

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, raw_input().split())
s_list = []
for i in range(n):
  s_list.append(raw_input())

s_list.sort()

print(''.join(s_list))

Submission status: Accepted

Solution code:
n, l = [int(i) for i in 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()))
word = []
for i in range(N):
	word.append(input())

word.sort()
print("".join(word))

Submission status: Accepted

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

line = []

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

#print(line)
line.sort()
#print(line)

print(''.join(line))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print "".join(sorted([raw_input() for _ in xrange(int(raw_input().split()[0]))]))

Submission status: Accepted

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

Submission status: Accepted

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

print (s)

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 = (int(i) for i in input().split())
str_ary = [input() for i in range(n)]

str_ary = sorted(str_ary)
str_sorted = ""
for s in str_ary:
    str_sorted += s
print(str_sorted)

Submission status: Accepted

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

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

str_list.sort()

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

print(ans)

Submission status: Accepted

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

for i in range(n):
  S.append(input())
else:
  S.sort()
  print("".join(S))

"""
文字列もlist.sort()で並べ替えができるよ！！！
あとは、joinメソッドを使うか、

for i in range(len(S)):
    str_print = str_print + S[i]
else:
    print(str_print)

の方法があるよ！！！
"""

Submission status: Accepted

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

for i in range(n):
  S.append(input())
else:
  S.sort()
  print("".join(S))

Submission status: Accepted

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

for x in s_s:
    moji += x

print(moji)

Submission status: Accepted

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

Submission status: Accepted

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

wordlist = []
output_word = ""

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

while wordlist:
  minimumword = wordlist[0]
  for i in range(len(wordlist)):
    minimumword = wordlist[i] if wordlist[i] < minimumword else minimumword

  output_word += minimumword
  del wordlist[wordlist.index(minimumword)]

print(output_word)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

tmp2 = sorted(s)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(*S,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

stringList.sort()
answer= ""
for i in range(N):
    answer = answer + stringList[i]
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = input().split(' ')

N = int(l[0])
L = int(l[1])
S=[]
for i in range(N):
    S.append(input())

S.sort()

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

print()

Submission status: Accepted

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

Submission status: Accepted

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

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

S.sort(reverse =False)

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

print(ans)

Submission status: Accepted

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

array = []
for i in range(n):
    array.append(input())
sort_array = sorted(array)
print("".join(sort_array))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys# {{{
import os
import time
import re
from pydoc import help
import string
import math
import numpy as np
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]# }}}

def local_input():
    from pcm.utils import set_stdin
    import sys
    if len(sys.argv) == 1:
        set_stdin(os.path.dirname(__file__) + '/test/' + 'sample-1.in')

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

if __name__ == "__main__":# {{{
    try:
        local_input()
    except:
        pass
    solve()
# vim: set foldmethod=marker:}}}

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
def main():
    n, l = map(int, input().split())
    
    s_lst = []
    for i in range(n):
        s_lst.append(input())
        
    s_lst.sort()
    
    print("".join(s_lst))
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,x=[int(i) for i in input().split()]
a=sorted([input().strip() for i in range(n)])

ans=""
for i in a:
  ans=ans+i
print(ans)

Submission status: Accepted

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

text.sort()
print(''.join(text))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = list(map(int,input().split()))
n,l = line[0],line[1]
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())
rec = []
for i in range(n):
    s = input()
    rec.append(s)
rec = sorted(rec)
t = ""
for i in range(n):
    t += rec[i]

print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,l = map(int,input().split())
dic = list()
ans=""

for i in range(n):
    dic.append(input())
    
dic = sorted(dic)

for word in dic:
    ans += word
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inn,gab = list(map(int,input().split()))
in1 = []
for i in range(inn):
  in1.append(input())
in1.sort()
r = ""
for i in range(inn):
  r+= in1[i]
print(r)

Submission status: Accepted

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

S = []
for i in range(N):
    S.append(input())
    
print("".join(sorted(S)))