PROGRAM ATCODER

implicit none
integer :: n, l, i, j
character(len = 100),allocatable :: a(:)
character(len = 100) :: c
character(len = 100*100) :: answer

read(*,*) n, l
allocate (a(n))

do i = 1, n
	read(*,*) a(i)
end do

! ここに計算式
do i = 1, n
	do j = i+1, n
		if (lgt(a(i),a(j)))then
			c = a (i)
			a(i) = a(j)
			a(j) = c
        end if
	end do
end do
! ここに出力結果

answer = trim(a(1))
do i = 2, n
	answer = trim(answer)//trim(a(i))
end do

write(*,'(a)') trim(answer)

END PROGRAM ATCODER