qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n, l = map(int, input().split())
l = []
for i in range(n):
	l.append(input())
l = list("".join(l))
l.sort()
l = "".join(l)
print(l)

Fixed code:
n, l = map(int,input().split())
a = []
for i in range(n):
    a.append(input())
    
a.sort()
print(''.join(a))
Buggy code:
# -*- coding: utf-8 -*-
n, l = map(int, input().split())
a = []
b = ''

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

for i in range(len(a)):
  b += a[i]
  
print(b)


Fixed code:
# -*- coding: utf-8 -*-
n, l = map(int, input().split())
a = []
b = ''

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

for i in range(len(a)):
  b += a[i]
print(b)
Buggy code:
n, l = [ v for v in input().split() ]
string_list = sorted([ v for v in input().split() ])
print("".join(string_list))

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

Fixed code:
n, l = map(int, input().split())
print("".join(sorted([input() for i in range(n)])))
Buggy code:
    N, L = map(int, input().split())
    data = []
    for _ in range(N):
        input_data = input()
        data.append(input_data)
    print(data)
    data.sort()
    print(''.join(data))


Fixed code:
N, L = map(int, input().split())
data = []
for _ in range(N):
    input_data = input()
    data.append(input_data)
data.sort()
print(''.join(data))
Buggy code:
n, l = map(int, input().split())
s = [int(input()) for i in range(n)]

s.sort()
S = ""
for i in s:
    S += i
print(S)


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

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

Fixed code:
n, l = map(int, input().split())
a = sorted([input() for _ in range(n)])
print(''.join(a))
Buggy code:
N, L = input().split()
S = [input() for i in range(N)]

print(*sorted(S), sep='')

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

print(*sorted(S), sep='')
Buggy code:
n,l = map(int,input().split())

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

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

Fixed code:
n,l = map(int,input().split())
s = [input() for _ in range(n)]
s.sort()
ss = ""
for i in range(n):
    ss += s[i]
print(ss)
Buggy code:
N, L = map(int, input().split())
strs = [[]] * N
for i in range(N):
  strs[i] = str(input())
strs.sort()
print(strs)
x = strs[0]
for j in range(1,N):
   x += strs[j]
print(x)

Fixed code:
N, L = map(int, input().split())
strs = [[]] * N
for i in range(N):
  strs[i] = str(input())
strs.sort()
x = strs[0]
for j in range(1,N):
   x += strs[j]
print(x)
Buggy code:
N, L = map(int, input().split())
S = [input() for s in range(L)]
S.sort()
output = ""
for i in S:
  output+=i
prunt(output)

Fixed code:
N, L = map(int, input().split())
S = [input() for s in range(N)]
S.sort()
output = ""
for i in S:
  output+=i
print(output)
Buggy code:
n,l = map(int,input().split())
s = []
for i in range(n):
    s.append(input())
print(sorted(s))


Fixed code:
n,l = map(int,input().split())
s = []
for i in range(n):
    s.append(input())
for i in sorted(s):
    print(i,end="")
Buggy code:
info = input().split()
lst = []
for i in range(int(info[0])):
  lst.append(str(input()))
lst = sorted(lst)
print(lst)

Fixed code:
info = input().split()
lst = []
for i in range(int(info[0])):
  lst.append(str(input()))
lst = "".join(sorted(lst))
print((lst))
Buggy code:
N, L = map(int,input().split())
S = sorted([input() for i in range(n)])
print(*S, sep="")

Fixed code:
N, L = map(int,input().split())
S = sorted([input() for i in range(N)])
print(*S, sep="")
Buggy code:
n, l = map(int, input().split())
sl = []
for i in range(n):
    s = input()
    sl.append(s)
sl.sort()
"print(sl)
ans = ""
for i in range(n):
    ans += sl[i]
print(ans)

Fixed code:
n, l = map(int, input().split())
sl = []
for i in range(n):
    s = input()
    sl.append(s)
sl.sort()
#print(sl)
ans = ""
for i in range(n):
    ans += sl[i]
print(ans)
Buggy code:
n,l = map(int,input().ssplit())
s = sorted([int(input()) for i in range(n)])
print(*s,sep="")

Fixed code:
n,l = map(int,input().split())
s = sorted([input() for i in range(n)])
print(*s,sep='')
Buggy code:
#!/usr/bin/env python3

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, l = map(int,input().split())
    s = []

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

    s_sorted = sorted(s)
    answer = ""

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

    print(answer)

if __name__ == '__main__':
    main()

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, l = map(int,input().split())
    s = []

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

    s_sorted = sorted(s)
    answer = ""

    for i in range(N):
        answer += s_sorted[i]

    print(answer)

if __name__ == '__main__':
    main()
Buggy code:
n,l=input().split()
N=int(n)
L=int(l)
s=[]
for i in range(N):
  s.append(input())
s.sort()
print(s.join(""))

Fixed code:
n,l=input().split()
N=int(n)
L=int(l)
s=[]
for i in range(N):
  s.append(input())
s.sort()
print(("").join(s))
Buggy code:
n, l = map(int,input().split())
list = []
for i in range(n):
    a = input()
    list.append(a)
for i in sorted(list):
    print(i)


Fixed code:
n, l = map(int,input().split())
list = []
for i in range(n):
    a = input()
    list.append(a)
print(''.join(sorted(list)))
Buggy code:
n, l = (int(x) for x in input().split())
s = [input() for _ in range(n)]
s.sort()
print(s)

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

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

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

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

mojiretu = ''.join(input_str) 
print(mojiretu)

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

mojiretu = ''.join(input_str) 
print(mojiretu)
Buggy code:
# 

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

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

print(ans)

Fixed code:
# 

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

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

print(ans)
Buggy code:
# input
n, l = map(int, input().split())
S = sorted([input() for _ in range(N)])

ans = ''

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

print(ans)


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

ans = ''

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

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

s = sorted(S)
print(*s)

Fixed code:
N, L = map(int, input().split())
S = [input() for i in range(N)]
s = sorted(S)
print(*s, sep='')
Buggy code:
n,l = map(int,input().split())
s = sorted[input() for _ in range(n)]
for i in range(n):
  print(*s,sep="")

Fixed code:
n,l=map(int,input().split())
s = sorted([input() for i in range(n)])
print(*s,sep='')
Buggy code:
N, L = map(int, input().split())
SList = []
for i in range(N):
    SList.append(input())
SList.sort()
ans = ','.join(SList)
print(ans)


Fixed code:
N, L = map(int, input().split())
SList = []
for i in range(N):
    SList.append(input())
SList.sort()
ans =""
for i in range(N):
    ans += SList[i]
print(ans)
Buggy code:
N, L = map(int, input().split())
SList = []
for i in range(N):
    SList.append(input())
SList.sort()
print(','.join(SList))


Fixed code:
N, L = map(int,input().split())
S = []
for i in range(N):
    S.append(input())
S.sort()
print("".join(S))
Buggy code:
n,l=map(int,input().split())
s=[]
ss=''
for i in range(n):
	s.append(input())
s=sorted(s)
for i in range(n):
	ss+=s[i]
print(print)

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

for i in range(N-1):
    start = N - i - 1
    print("start " + str(start))
    for j in range(start):
        print(str(start-j-1) + " " + str(start-j))
        Left = String[start-j-1]
        Right = String[start-j]
        if Left > Right:
            String[start-j-1] = Right 
            String[start-j] = Left

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

Fixed code:
N, L = (int(i) for i in input().split())
String = [input() for s in range(N)]

for i in range(N-1):
    start = N - 1
    #print("start " + str(start))
    for j in range(start-i):
        #print(str(start-j-1) + " " + str(start-j))
        Left = String[start-j-1]
        Right = String[start-j]
        if Left > Right:
            String[start-j-1] = Right 
            String[start-j] = Left

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

Fixed code:
n, l = map(int, input().split())
list = []
for i in range(n):
  list.append(input())
list.sort()
print("".join(list))
Buggy 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)

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

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

s = sorted(s)
print(s)

Fixed code:
n, l = map(int, input().split())
s = list()
for i in range(n):
  s.append(input())

s = sorted(s)
print(''.join(s))
Buggy code:
n,m=map(int,input().split())
mat=[]
for i in range(n):
    mat.append(list(input()))
mat.sort(key=lambda x:x)
ans=''
for i in mat:
    ans+=i 
print(ans) 

Fixed code:
n,m=map(int,input().split())
mat=[]
for i in range(n):
    mat.append(input())
mat.sort(key=lambda x:x)
ans=''
for i in mat:
    ans+=i 
print(ans)
Buggy code:
N,L = map(int, input().strip().splip(' '))
print(''.join(sorted([input().strip() for _ in range(N)])))

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

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

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


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

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

Fixed code:
n,l=map(int,input().split())
list=[]
for _ in range(n):
    list.append(input())
 
list.sort()
ans=""
for i in list:
    ans+=i
print(ans)
Buggy code:
N,L = map(int,input().split())
S = []
ans = ""
for i in range(N):
  S.append(input())
sorted(S)
for i in range(len(S)):
  ans += S[i]
print(ans)

Fixed code:
N,L = map(int,input().split())
S = []
ans = ""
for i in range(N):
  S.append(input())
S.sort()
for i in range(len(S)):
  ans += S[i]
print(ans)
Buggy code:
n,l = [int(i) for i in input().split()]
ss = [input() for _ in range(n)]
ss.sort()
for s in ss:
  print(s, sep="")
print("")

Fixed code:
n, l = [int(i) for i in input().split()]
ss = [input() for _ in range(n)]
ss.sort()
for s in ss:
    print(s, end="")
print("")
Buggy code:
n,l=map(int,input().split)
s=sorted([input() for i in range(n)])
print(*s,sep="")

Fixed code:
n,l=map(int,input().split())
t=sorted([input() for i in range(n)])
print(*t,sep="")
Buggy code:
NL = [ x for x in map(int,input().split()) ]
cha = []
i = 0
while i < NL[0]:
  cha.append(input())
  i += 1
print(sorted(cha))

Fixed 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)))
Buggy code:
a=input().split()
b=int(a[0])
data = [input() for i in range(b)]
data.sort()
print(data)

k=""
for i in data:
    k=k+i
print(k)

Fixed code:
a=input().split()
b=int(a[0])
data = [input() for i in range(b)]
data.sort()
#print(data)

k=""
for i in data:
    k=k+i
print(k)
Buggy code:
n,l = map(int,input().split())
x = [str(input()) for _ range(n)]
x.sort()
a = ' '
for i in x:
  a += i
print(a)

Fixed code:
n,l = map(int,input().split())
x = [str(input()) for _ in range(n)]
x.sort()
a = ' '
for i in x:
  a += i
print(a)
Buggy code:
n, l = map(int, input().split())
a = sorted([input() for i in range(n)])
print("".join(s))

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

Fixed code:
n, l = map(int, input().split())
lst = [input() for _ in range(n)]
lst.sort()
print("".join(lst))
Buggy code:
ln_list = list(map(int, input().split()))
print(ln_list)
l = []
for list in range(ln_list[0]):
  l.append(input())
l.sort()
a = ''.join(l)
print(a)

Fixed 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)
Buggy code:
from sys import stdin, stdout
from time import perf_counter

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

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

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

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

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

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

n,l = map(int,input().split())
a = [input() for item in range(n)]
b = sorted(a)
print(''.join(b))
Buggy code:
from sys import stdin, stdout
from time import perf_counter

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





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


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

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





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

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

val_list=[]

for x in range(int(splited_val[0])):
    val = input()
    val_list.append(val)

print(sorted(val_list))

Fixed code:
val = input()
splited_val = val.split()

val_list=[]

for x in range(int(splited_val[0])):
    val = input()
    val_list.append(val)

print("".join(sorted(val_list)))
Buggy code:
N, _ = [int(i) for i in input().split()]
S = [input() for _ in range(N)]
ans = "".join(sorted(s))
print(ans)

Fixed code:
N, _ = [int(i) for i in input().split()]
S = [input() for _ in range(N)]
ans = "".join(sorted(S))
print(ans)
Buggy code:
n, l = map(int, input().split(" "))
ln = []

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

s = ""
for word in ln:
  s += word
  
print(ln)
print(s)

Fixed code:
n, l = map(int, input().split(" "))
ln = []

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

s = ""
for word in ln:
  s += word
  
print(s)
Buggy code:
N, L = map(int, input().split())
''.join(sorted([input() for i in range(N)]))

Fixed code:
N, L = map(int, input().split())
nums = sorted([input() for i in range(N)])
print(''.join(nums))
Buggy code:
# -*- coding: utf-8 -*-


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

if __name__ == '__main__':
    main()

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


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

    
if __name__ == '__main__':
    main()
Buggy code:
n, l = map(int, input().split())
a = sorted([input() for i in range(n)])
print(a)

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

Fixed code:
n,l=map(int,input().split())
moji=[]
for i in range(n):
  moji.append(input())
moji.sort()
print("".join(moji))
Buggy code:
# -*- coding: utf-8 -*-
# problem B

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

for _ in N:
    input_data = input()
    ls.append(input_data)

ls.sort()
print(''.join(ls))

Fixed code:
# -*- coding: utf-8 -*-
# problem B

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

for _ in range(N):
    input_data = input()
    ls.append(input_data)

ls.sort()
print(''.join(ls))
Buggy code:
n,l=list(map(int,input().split()))
S=[list(input()) for i in range(n)]
[S[i].sort() for i in range(len(S))]
S.sort()
ans=''.join(S[0])
print(ans)

Fixed code:
n,l=list(map(int,input().split()))
S=[input() for i in range(n)]
S.sort()
ans=''.join(S)
print(ans)
Buggy code:
N,L = map(int,input().split())
S = sorted(list(input() for i in range(N)))
print(*s,sep="")

Fixed code:
N,L = map(int,input().split())
S = sorted(list(input() for i in range(N)))
print(*S,sep="")
Buggy code:

def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('a')+1)
    return num

def string2num(str):
    _N = len(str)
    num=0
    for n in range(_N):
        num+=alpha2num(str[n])* (26**(_N-1-n))
    return num

if __name__ == "__main__":
    N,L = (int(x) for x in input().split())
    S = []
    S2Num=[]
    for n in range(N):
        _str = input()
        S.append(_str)
        S2Num.append(string2num(_str))
    print(S2Num)
    ans =""
    for key in sorted(range(len(S2Num)), key=lambda k: S2Num[k]):
        ans+=S[key]
    print(ans)

Fixed code:

def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('a')+1)
    return num

def string2num(str):
    _N = len(str)
    num=0
    for n in range(_N):
        num+=alpha2num(str[n])* (26**(_N-1-n))
    return num

if __name__ == "__main__":
    N,L = (int(x) for x in input().split())
    S = []
    S2Num=[]
    for n in range(N):
        _str = input()
        S.append(_str)
        S2Num.append(string2num(_str))
    ans =""
    for key in sorted(range(len(S2Num)), key=lambda k: S2Num[k]):
        ans+=S[key]
    print(ans)
Buggy code:
N, L = map(int, input().split())

char_list= []
for dummy in range(N):
    char_list.append(str(input())

answer = ""
for char in sorted(char_list):
    answer += char

print(answer)

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

char_list = []

for dummy in range(N):
    S = str(input())
    char_list.append(S)

char_list = sorted(char_list)
answer = ""
for char in char_list:
    answer += char

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

s.sort()

print(''.join(s))

Fixed code:
n,l=map(int, input().split()) #a1 a2 a3

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

s.sort()


print(''.join(s))
Buggy code:
N, L = map(int, input().split())
result = []

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

Fixed code:
N, L = map(int, input().split())
result = []
 
for i in range(N):
  result.append(input())
 
print("".join(sorted(result)))
Buggy code:
N, L= map(int,input().split())
alldata = sorted([input() for i in range(N)])
print("".join(data))


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

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

s.sort()

print(s)

print(''.join(s))



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

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

s.sort()

print(''.join(s))
Buggy code:
print("".join(sorted([input() for _ in range(input().split()[0]))))

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

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

             
print(a

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

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

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

Fixed code:
n,l=map(int,input().split())
s=[input() for i in range(n)]
s.sort()
print(*s,sep="")
Buggy code:
n,l=map(int,input().split())
s=[]
for i range(n):
  s.append(input())
s.sort()
ans=''
for x in s:
  ans+=x
print(ans)


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


Fixed code:
N, L = map(int, input().split())
s=[]
for i in range(N):
  s.append(input())
s.sort()
ans = ''
for x in s:
    ans += x
print(ans)
Buggy code:
a,b=map(int,input().split())
s=sorted([input() for i in range(n)])
print(*s,sep="")


Fixed code:
a, b = map(int, input().split())
s=sorted([input() for i in range(a)])
print(*s,sep="")
Buggy code:
ip1 = input().split()
N = int(ip1[0])
L = int(ip1[1])
strings = []
for i in range(N):
    strings.append(input())
strings.sort()
ans = ""
for i in range(len(strings)):
    ans += string[i]

print(ans)


Fixed code:
ip1 = input().split()
N = int(ip1[0])
L = int(ip1[1])
strings = []
for i in range(N):
    strings.append(input())
strings.sort()
ans = ""
for i in range(len(strings)):
    ans += strings[i]

print(ans)
Buggy code:
N,L=map(int, input().split())
str_lists = []
for i in xrange(N):
  str_lists.append(input())
print(''.join(sorted(str_lists)))

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

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


Fixed code:
N,L = map(int,input().split())
S = sorted([input() for i in range(N)])
print(*S,sep = "")
Buggy code:
(n,l)=map(int, input().split())
list1=list(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Fixed code:
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")
Buggy code:
n,l=map(int,input().split())

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

order=sorted(s)
print(order)
ans=''.join(order)

print(ans)

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

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



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