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: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): return print(arg)
def Y(): print("Yes"); return
def N(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

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

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N,L = IL()
S = SLs(N)

S.sort()

P(*S,sep="")

Submission status: Runtime Error

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

word_dict = {}
for i in range(N):
  word_dict.[i](input())

def hikaku(a, b):
  for i,j in zip(a,b):
    if a < b:
      return a, b
    if b < a:
      return b, a

for i in range(1, N-1):
  for j in range(N-j):
    a,b = word_dict[j], word_dict[j+1]
    a,b = hikaku(a, b)
    word_dict[j], word_dict[j] = a, b
return_word = ""
for i in word_dict:
  return_word += word_dict[i]
print(return_word)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(''.join(sorted(list))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
strs = []
for i in range(N):
    n = input()
    strs.append(n)

strs = sorted(strs)
strs = ''.join(strs)

print(strs)

Submission status: Runtime Error

Solution code:
input = input().split(" ")
N = input[0]
L = input[1]

inputs = list()
for n in range(N):
  list.append(input())

inputs.sort()
answer = "".join(inputs)
print(answer)

Submission status: Runtime Error

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

inputs = []
for n in range(N):
  inputs.append(input())

inputs.sort()

answer = "".join(inputs)
print(answer)

Submission status: Runtime Error

Solution code:
NL = input().split()
N = int(NL[0])
L = int(NL[1])
aba = ["axx", "fxx", "dxx"]
st = []
for i in range(N):
    a = aba[i]
    st.append(a)
s_st = sorted(st)
dic = ""
for j in range(len(s_st)):
    dic += s_st[j]
print(dic)

Submission status: Runtime Error

Solution code:
NL = ["3", "3"]
N = int(NL[0])
L = int(NL[1])

st = []
for i in range(N):
    a = input()
    st.append(a)
s_st = sorted(st)
dic = ""
for j in range(len(s_st)):
    dic += s_st[j]
print(dic)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, l;
    cin >> n >> l;
    vector<string> s(n);
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }

    sort(s.begin(), s.end());

    for(int i = 0; i < n; i++){
        cout << s[i];
    }

    cout << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ANSlist = sorted(Mylist)
ANS = ''.join(ANSlist)
print(ANS)

Submission status: Runtime Error

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

s.sort()


print(''.join(s))

Submission status: Runtime Error

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

s.sort()

print(''.join(s))

Submission status: Runtime Error

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

s = [input() for _ in range(n)]
i = sorted(s)
print(''.join(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = [int(x) for x in input().split(' ')][1]
 
l = []
for i in range(x):
  l += [input()]
  
print(''.join(sorted(l)))

Submission status: Runtime Error

Solution code:
x = [int(x) for x in input().split()][1]
 
l = []
for i in range(x):
  l += [input()]
  
print(''.join(sorted(l)))

Submission status: Runtime Error

Solution code:
x = [int(x) for x in input().split()][1]

l = []
for i in range(x+1):
  l += [input()]
  
print(''.join(sorted(l)))

Submission status: Runtime Error

Solution code:
l = [x for x in input().split(' ')]
l = sorted(l)
print ''.join(l)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

S.sort（）
str1=''
for i in range (H):
    str1=str1+S[i] 
print(str1)

Submission status: Runtime Error

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

S.sort（）
str1=''
str1.append(S[i] for i in range (H))
print(str1)

Submission status: Runtime Error

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

S.sort（）
str1=''
str1.append(S[i] for i in range (H))

Submission status: Runtime Error

Solution code:
n,b=list(input().split())

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

print(''.join(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
list=sorted[input()]
print(*list,sep="")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
t = [input() for i in range(s[0])]
for i in range(0, s[0] - 1):
    if t[i] > t[i + 1]:
        u = t[i]
        t[i] = t[i + 1]
        t[i + 1] = u
v = 0
for i in range(0, s[0]):
    v = v + t[i]
v

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
t = [input() for i in range(s[0])]
for i in range(0, s[0] - 1):
    if t[i] > t[i + 1]:
        u = t[i]
        t[i] = t[i + 1]
        t[i + 1] = u
v = 0
for i in range(0, s[0]):
    v = v + t[i]
t[i]

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
t = [input() for i in range(s[0])]
for i in range(0, s[0] - 1):
    if t[i] > t[i + 1]:
        u = t[i]
        t[i] = t[i + 1]
        t[i + 1] = u
print(t[0] + t[1] + t[2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print("".join(sorted(List))

Submission status: Runtime Error

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

print(''.join(sorted(List))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
number,length=input().split()
input_list=[]
out=''
for i in range(number):
    input_list.append(input())
input_list.sort()
for i in input_list:
    out+=i
print(out)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def sort(str_list):
  for i in range(len(str_list) - 1):
    string = str_list[i]
    for j in range(i + 1, len(str_list)):
      next_string = str_list[j]
      for k in range(len(string)):
        if ord(string[k]) > ord(next_string[k]):
          temp = string
          str_list[i] = next_string
          str_list[j] = temp
          break
        elif ord(string[k]) == ord(next_string[k]):
          continue
        else:
          break
  ans = ""
  for i in str_list:
    ans += i
  return ans
 
line1 = input().split()
n = line1[0]
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))
  
def sort(str_list):
  for i in range(len(str_list) - 1):
    string = str_list[i]
    for j in range(i + 1, len(str_list)):
      next_string = str_list[j]
      for k in range(len(string)):
        if ord(string[k]) > ord(next_string[k]):
          temp = string
          str_list[i] = next_string
          str_list[j] = temp
          break
        elif ord(string[k]) == ord(next_string[k]):
          continue
        else:
          break
  ans = ""
  for i in str_list:
    ans += i
  return ans

line1 = input().split()
n = int(line1[0])
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))

Submission status: Runtime Error

Solution code:
def sort(str_list):
  for i in range(len(str_list) - 1):
    string = str_list[i]
    for j in range(i + 1, len(str_list)):
      next_string = str_list[j]
      for k in range(len(string)):
        if ord(string[k]) > ord(next_string[k]):
          temp = string
          str_list[i] = next_string
          str_list[j] = temp
          break
        elif ord(string[k]) == ord(next_string[k]):
          continue
        else:
          break
  ans = ""
  for i in str_list:
    ans += i
  return ans

line1 = input().split()
n = line1[0]
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def resolve():
	n, m = map(int, input().split())
	w = list()
	ans = ""
	for _ in range(m):
		w.append(input())
	w.sort()
	for word in w:
		ans += word
	print(ans)

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
	n, m = map(int, input().split())
	w = list()
	ans = ""
	for _ in range(m):
		w.append("".join(sorted(input())))
	w.sort()
	for word in w:
		ans += word
	print(ans)

resolve()

Submission status: Runtime Error

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

blank = []
blank.append(str1)
blank.append(str2)
blank.append(str3)

blank.sort()
new = blank[0]+blank[1]+blank[2]
print(new)

Submission status: Runtime Error

Solution code:
def resolve():
	n, m = map(int, input().split())
	w = list()
	for _ in range(m):
		w.append(input())
	w.sort()
	print("".join(w))

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
	n, m = map(int, input().split())
	w = list()
	for _ in range(m):
		w.append(input())
	w.sort()
	print("".join(w))
resolve()

Submission status: Runtime Error

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

words = [input() for i in range(len(N))]

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

for word in words:
    print(word)

Submission status: Runtime Error

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

words = [input() for i in range(len(N))]

words.sort(lambda x: x[0])

for word in words:
    print(word)

Submission status: Runtime Error

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

words = [input() for i in range(len(N))]

words.sort(lambda word: word[0])

for word in words:
  print(word)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
L = int(input())
print(*sorted(input() for i in range(L)), sep='')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s = sorted(S)
print(*s)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

list.sort()
ans=""
for i in len(list):
    ans+=list[i]
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

D.sort()
m=""
for i in S:
    m+=i

print(m)

Submission status: Runtime Error

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

S.sort(D,reverse=False)
m=" "
for i in S:
    m+=i

print(m)

Submission status: Runtime Error

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

S=sorted(D,reverse=False)
m=" "
for i in S:
    m+=i

print(m)

Submission status: Runtime Error

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

s.sort()
newlist = sorted(s)
print(''.join(newlist))

Submission status: Runtime Error

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

print(sorted(S))

Submission status: Runtime Error

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

P = []
s = sorted(S)
for q in s:
  P.append(q)

print(P)

Submission status: Runtime Error

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

p = sorted(P)
ppp = "".join(map(str, p))
print(ppp)

Submission status: Runtime Error

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

p = sorted(P)
print(p[0] + p[1] + p[2])

Submission status: Runtime Error

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

word = []

for i in range(M):
  word.append(input())
  
word.sort()

print(''.join(word))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(''.join(L))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

SS = sorted(S)
ans = ""

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

print(ans)

Submission status: Runtime Error

Solution code:
N,L=map(int,input().split())
l=[input() for i in range(N)]
a=sorted(l)
b=a[0]+a[1]+a[2]
print(b)

Submission status: Runtime Error

Solution code:
N,L=map(int,input().split())
l=[input() for i in range(N)]
a=sorted(l)
print(a[0]+a[1]+a[2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(1,int(N[0]),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: Runtime Error

Solution code:
N = int(input())
L_num = int(input())
list = []

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: Runtime Error

Solution code:
n, l = map(int, input().split())
strs = [input().split() for i in range(n)]
concat = strs[0]
del strs[0]
for str in strs:
  for i in range(len(concat) / l):
	  if concat[i*l] < str:
        concat = concat[:i*l] + str + concat[i*l:]
        break
      if i == len(concat) / l -1:
        concat = concat + str
print(concat)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input().rstirp().split()
n = [int(x) for x in n]

arg=[]
for i in range(n[0]):
  data = input().rstrip()
  arg.append(data)
sorted(arg)
for j in range(n[0]):
  print(arg[j],end="")
print("\n")

Submission status: Runtime Error

Solution code:
n = input().rstirp().split()
n = [int(x) for x in n]

arg=[]
for i in range(n[0]):
  data = input().rstrip()
  arg.append(data)
sorted(data)
for j in range(n[0]):
  print(arg[j],end="")
print("\n")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num = list(map(input().split()))
word = [input() for i in range(num[0])]
print(''.join(sorted(word)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,(input().split()))
li=[]
for i in range(a):
    li.append(input())
li.sort
a=li[0]
for j in range(1,a):
    a+=li[j]
print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
text=[input() for i in range(n)]
print("".join(sorted(text)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input())
ans = {}
for i in range(N):
    A = input()
    ans[A]=1
ans = sorted(ans)
print("".join(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#print(S)
S = sorted(S)
#print("sorted", S)
total = "".join(S)
print(total)

Submission status: Runtime Error

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

#print(S)
S = sorted(S)
#print("sorted", S)

total = ''
for i in range(len(S)):
  total += str(S[i])

print(total)

Submission status: Runtime Error

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

#print(S)
S = sorted(S)
#print("sorted", S)

total = ''
for i in range(len(S)):
  total += S[i]

print(total)

Submission status: Runtime Error

Solution code:
n = input().split()
N = int(n[0])
L = int(n[1])
a = []
for i in range(L):
    b = input()
    a.append(b)
A = sorted(a)
print(''.join(A))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

words.sort()

for i in range(N-1):
  print(words[i], end="")
print(words[i+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X, L = [int(input()) for i in range(2)]
li = sorted([input() for i in range(X)])
ans = ''

for i in li:
    ans += i

print(ans)

Submission status: Runtime Error

Solution code:
def getlist():
    return list(map(int, input().split()))
  
a,b = getList()
lis = []
for i in range(a):
  lis.append(input().strip())
  
lis.sort()
print("".join(lis))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,l = map(int,input().split())
s = input() for i in range(n)
print(*stored(s),sep="")

Submission status: Runtime Error

Solution code:
n = input()
l = input()
s = input() for i in range(n)
print(*stored(s),sep="")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

S1 = sorted(S)

S2 ="".join(S1)

print(S2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num, size = map(int,input().split())
data =[]
for x in range(num):
    data.apend(input())
print(data.sort().join())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
l=int(input())
arr = ["" for x in range(n)]
for i in range(n):
    arr[i]=input()
arr.sort()
for i in range(n):
    print(arr[i],end="")

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input())
l=[]
for _ in range(0,N):
    s=input()
    l.append(s)
s=""
l.sort()

for i in l:
    s = s+i
print(s)

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input())
l=[]
for _ in range(0,N):
    l.append(input())
s=""
l.sort()

for i in l:
    s = s+i
print(s)

Submission status: Runtime Error

Solution code:
# cook your dish here
s=input()
m=s.split()
n=int(s[0]);
l=int(s[2]);
list=[]
for i in range(n):
    st=input()
    list.append(st)
list.sort()
for i in list:
    print(i,end="")

Submission status: Runtime Error

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

for i in range(N):
  result.append(i)
 
print("".join(sorted(result)))