import sys



input_methods=['clipboard','file','key']

using_method=0

input_method=input_methods[using_method]



IN=lambda : list(map(int, input().split()))

mod=1000000007



#+++++



def main():

	a, c = IN()

	ss = [eval(input()) for _ in range(a)]

	ss.sort()

	ret = ''.join(ss)

	print(ret)

	

	

#+++++

isTest=False



def pa(v):

	if isTest:

		print(v)

		

def input_clipboard():

	import clipboard

	input_text=clipboard.get()

	input_l=input_text.splitlines()

	for l in input_l:

		yield l



if __name__ == "__main__":

	if sys.platform =='ios':

		if input_method==input_methods[0]:

			ic=input_clipboard()

			input = lambda : ic.__next__()

		elif input_method==input_methods[1]:

			sys.stdin=open('inputFile.txt')

		else:

			pass

		isTest=True

	else:

		pass

		#input = sys.stdin.readline

			

	ret = main()

	if ret is not None:

		print(ret)
import sys



input_methods=['clipboard','file','key']

using_method=0

input_method=input_methods[using_method]



IN=lambda : list(map(int, input().split()))

mod=1000000007



#+++++



def main():

	#a = int(input())

	n,l = IN()

	ss=[]

	for _ in range(n):

		s = eval(input())

		ss.append(s)

	ss.sort()

	return ''.join(ss)

	

	

	

#+++++

isTest=False



def pa(v):

	if isTest:

		print(v)

		

def input_clipboard():

	import clipboard

	input_text=clipboard.get()

	input_l=input_text.splitlines()

	for l in input_l:

		yield l



if __name__ == "__main__":

	if sys.platform =='ios':

		if input_method==input_methods[0]:

			ic=input_clipboard()

			input = lambda : ic.__next__()

		elif input_method==input_methods[1]:

			sys.stdin=open('inputFile.txt')

		else:

			pass

		isTest=True

	else:

		pass

		#input = sys.stdin.readline

			

	ret = main()

	if ret is not None:

		print(ret)
import sys

input_methods = ["clipboard", "file", "key"]
using_method = 0
input_method = input_methods[using_method]
IN = lambda: list(map(int, input().split()))
mod = 1000000007
# +++++
def main():
    a, c = IN()
    ss = [eval(input()) for _ in range(a)]
    ss.sort()
    ret = "".join(ss)
    print(ret)


# +++++
isTest = False


def pa(v):
    if isTest:
        print(v)


def input_clipboard():
    import clipboard

    input_text = clipboard.get()
    input_l = input_text.splitlines()
    for l in input_l:
        yield l


if __name__ == "__main__":
    if sys.platform == "ios":
        if input_method == input_methods[0]:
            ic = input_clipboard()
            input = lambda: ic.__next__()
        elif input_method == input_methods[1]:
            sys.stdin = open("inputFile.txt")
        else:
            pass
        isTest = True
    else:
        pass
        # input = sys.stdin.readline
    ret = main()
    if ret is not None:
        print(ret)

import sys

input_methods = ["clipboard", "file", "key"]
using_method = 0
input_method = input_methods[using_method]
IN = lambda: list(map(int, input().split()))
mod = 1000000007
# +++++
def main():
    # a = int(input())
    n, l = IN()
    ss = []
    for _ in range(n):
        s = eval(input())
        ss.append(s)
    ss.sort()
    return "".join(ss)


# +++++
isTest = False


def pa(v):
    if isTest:
        print(v)


def input_clipboard():
    import clipboard

    input_text = clipboard.get()
    input_l = input_text.splitlines()
    for l in input_l:
        yield l


if __name__ == "__main__":
    if sys.platform == "ios":
        if input_method == input_methods[0]:
            ic = input_clipboard()
            input = lambda: ic.__next__()
        elif input_method == input_methods[1]:
            sys.stdin = open("inputFile.txt")
        else:
            pass
        isTest = True
    else:
        pass
        # input = sys.stdin.readline
    ret = main()
    if ret is not None:
        print(ret)

-    a, c = IN() -    ss = [eval(input()) for _ in range(a)] +    # a = int(input()) +    n, l = IN() +    ss = [] +    for _ in range(n): +        s = eval(input()) +        ss.append(s) -    ret = "".join(ss) -    print(ret) +    return "".join(ss)