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

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

Submission status: Accepted

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

s_list = []
s_list.append(input())

for i in range(n-1):
  s = input()
  for j in range(len(s_list)):
    if s_list[j] >= s:
      s_list.insert(j, s)
      break
    elif j == len(s_list) - 1:
      s_list.append(s)

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

Submission status: Accepted

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

for str in sortstr:
  print(str,  end='')
print()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# int(input()) # 入力が1つ
n, l = map(int, input().split()) # 入力が複数

strings = []
for _ in range(n):
    strings.append(input()[:-1])

strings.sort()
ans = ''.join(strings)
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 range(N):
  b += a[i]
print(b)

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:
line1 = input().split(' ')
line1 = list(map(int, line1))
N = line1[0]
L = line1[1]
strings = []
for n in range(N):
  strings.append(input())
strings = sorted(strings)
print(''.join(strings))

Submission status: Accepted

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

Submission status: Accepted

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

N,L = map(int,input().split())
S = list()
for i in range(N):
    s = input().rstrip()
    S.append(s)

S.sort()

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lis=input().split()
string_list=[input() for i in range(int(lis[0]))]
string_list.sort()
print(''.join(string_list))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

sum = ""
for i in sort_list:
  sum += i


print(sum)

Submission status: Accepted

Solution code:

def main():
    t = input().split()
    li = []
    for i in range(int(t[0])):
        li.append(input())
    print(''.join(sorted(li)))



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

N, L = (int(x) for x in input().split())
S = list(input() for i in range(N))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
newString = ""
for i in range(n): 
    string = input()
    newString = newString + string + " "
words = newString.split()
words.sort()
for i in words: 
    print(i, end="")

Submission status: Accepted

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

print("".join(sorted(strings)))

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    b, c = map(int, input().split())
    a =[]

    for i in range(b):
        s = input()
        a.append(s)
    a.sort()

    print("".join(a))

Submission status: Accepted

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

Submission status: Accepted

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

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

li=sorted(li)
s=''

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

print(s)

Submission status: Accepted

Solution code:
str_num, str_len = map(int, input().split())
str_list = []
for i in range(str_num):
    str_list.append(input())
str_list.sort()
print("".join(str_list))

Submission status: Accepted

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

s = []

for i in range(n):
    s.append(list(map(str,input())))

s_ord = [[0]*(l) for i in range(n)]

for i in range(n):
    for j in range(l):
        s_ord[i][j] += ord(s[i][j])

s_ord_sorted = sorted(s_ord)

s_sorted = ""

for i in range(n):
    for j in range(l):
        s_sorted += chr(s_ord_sorted[i][j])

print(s_sorted)

Submission status: Accepted

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

M = sorted(M)

print(''.join(M))

Submission status: Accepted

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

Submission status: Accepted

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

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

a = sorted(l)

print(*a, sep='')

Submission status: Accepted

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

Submission status: Accepted

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

SS = sorted(S)
ans = ""

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

print(ans)

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

combined_char = ""

for cl in char_list:
    combined_char += cl

print(combined_char)

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(''.join(sorted(palavras)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


mojiretu = ""
S.sort()

for x in S:
    mojiretu += x

print(mojiretu)

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:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


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


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]"
    solve(N, L, S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,l = map(int,(input().split())) #N個の長さLの文字列
s = [input() for i in range(n)]
s.sort()
result = ""
for i in range(n):
    result = result + s[i]
print(result)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
a=[input() for i in range(n)]
a.sort()
print(*a,sep="")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc042/tasks/abc042_b

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

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

Submission status: Accepted

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

Submission status: Accepted

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

s.sort()
print(*s,sep="")

Submission status: Accepted

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

S.sort()

print(*S, sep="")

Submission status: Accepted

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

a = [str(input()) for i in range(N)]

print("".join(list(sorted(a))))

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

print("".join(d))

Submission status: Accepted

Solution code:
N,L = (int(x) for x in 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())
list = []
for s in range(n):
  list.append(input())
 
s_list = sorted(list)
print(*s_list, sep='')

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

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

a.sort()

print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

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

num = list_in[0]
length = list_in[1]

list_str = [None] * num
list_flags = [0] * num

for i in range(num):
    list_str[i] = input()

result = ""
str = "xxxx"
for i in range(num):
    idx = -1
    for j, flag in enumerate(list_flags):
        if flag != 0:
            continue
        elif idx < 0 and flag == 0:
            str = list_str[j]
            idx = j
        else:
            tmp_str = list_str[j]
            if str > tmp_str:
                str = tmp_str
                idx = j

    result = ''.join([result, str])
    list_flags[idx] = 1

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key



__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    N, L = mulinputs()
    datas = []
    for _ in range(N):
        datas.append(input())
    datas.sort()
    # 出力
    print(''.join(datas))



# EOF

Submission status: Accepted

Solution code:
input()
import sys
a = []
for l in sys.stdin:
    a.append(l.replace("\n",""))
b = sorted(a,reverse=True)
c = ""
for i in b:
  c = i + c
print(c)

Submission status: Accepted

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

s =[input()for i in range(int(n))]

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

Submission status: Accepted

Solution code:
#abc042_b
N, M = 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())

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

Submission status: Accepted

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

Submission status: Accepted

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

slist.sort()

print(''.join(slist))

Submission status: Accepted

Solution code:
N = input().split()
list = []

N = int(N[0])
for i in range(1,N+1,1):
    list.append(input())

list.sort(reverse = False)

ans = ""
for i in range(1,N+1,1):
    ans = ans + list[0]
    list.pop(0)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

text.sort()
print("".join(text))

Submission status: Accepted

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

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = []

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

S.sort()

res = ''

for i in S:
    res += i

print(res)

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

lst = []
for i in range(0, n):
    lst.append(input())

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

Submission status: Accepted

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

s = sorted(s)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
"""
kari1 = '3 3'
in1 = kari1.split()
mylist = []
mylist.append('dxx')
mylist.append('axx')
mylist.append('cxx')
"""
in1 = input().split()
mylist = []
for num in range(int(in1[0])):
    mylist.append(input())

mylist.sort()

print(''.join(mylist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from heapq import heappop, heapify, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
S = [input() for i in range(A)]

S.sort()
print(*S, sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,L=map(int,input().split())
S=[]
ans=""
for _ in range(N):
    S.append(input())
SS=sorted(S)
for _ in range(N):
    ans+=SS[0]
    SS.pop(0)
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# input
n, l = map(int, input().split())
s_list = []
for i in range(n):
    s_list.append(input())

# initialization
ans_str = ""
s_list = sorted(s_list)

# integrate
for s in s_list:
    ans_str += s

# output
print(ans_str)

Submission status: Accepted

Solution code:
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())
a = [input() for _ in range(n)]

a.sort()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# printデバッグ用
import sys
argVec = sys.argv
if len(argVec) > 1:
    GBN_DEBUG = True
else:
    GBN_DEBUG = False

def dprn(s, i):
    if GBN_DEBUG:
        print(", " + s + " = " + str(i), end = "")

def dprns(s):
    if GBN_DEBUG:
        print(", " + s, end = "")

def dprni(i):
    if GBN_DEBUG:
        print(str(i), end=" ")

#S = input()
#N = int(input())
#S, T = input().split() 
N, L = map(int, input().split()) 
S = [input() for _ in range(N)]
#A = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
n, l = map(int,input().split())
s = []
for i in range(n):
    s.append(str(input()))

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n, l = MAP()
s = [STR() for _ in range(n)]
s.sort()
print(''.join(s))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input().split()
#s[0]文字列の個数、s[1]文字列の長さ

wordCNT = int(s[0])

mylist = []

for num in range(wordCNT):
    mylist.append(input())

mylist.sort()

print(''.join(mylist))

Submission status: Accepted

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

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

list.sort(reverse=False)

for i in range(N):
  R += list[i]
  
print(R)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ss.sort()

print("".join(ss))

Submission status: Accepted

Solution code:


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,L=MI()
    S=[]
    for i in range(N):
        s=input()
        S.append(s)
        
    S.sort()
    print(''.join(map(str, S)))

main()

Submission status: Accepted

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

for i in range(n):
    line = input()
    l.append(line)
    
print("".join(sorted(l)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 i in range(N):
    s=input()
    A.append(s)
B=sorted(A)
for i in range(N):
    print(B[i],end="")

Submission status: Accepted

Solution code:
NL = [ x for x in map(int,input().split()) ]
cha = []
i = 0
while i < NL[0]:
  cha.append(input())
  i += 1
print(''.join(sorted(cha)))

Submission status: Accepted

Solution code:
from sys import stdin

lines = stdin.readlines()
counter = []
each_line = []
for i, line in enumerate(lines):
    if i == 0:
        counter = [int(x) for x in (line.rstrip().split())]
    else:
        each_line.append(str(line.rstrip()))

line_sort = sorted(each_line)

answer = str()
for i in range(counter[0]):
    answer += line_sort[i]

print(answer)

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

Submission status: Accepted

Solution code:
N, L, *S = open(0).read().split()
S.sort()
print(''.join(S))

Submission status: Accepted

Solution code:
import sys

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

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

s.sort()

min_str = ""

for item in s:
    min_str += item

print("{}".format(min_str))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

d = []
for _ in range(s):
  d.append(input())
d.sort()
print(''.join(d))

Submission status: Accepted

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