program main
	implicit none
    integer H, W, i, j
	character(1), allocatable :: a(:,:)
	read(*, *) H, W
	allocate(a(0:H+1, 0:W+1))
	a(0:H+1, 0:W+1) = '#'
	do i = 1, H
		do j = 1, W-1
			read(*, '(a1)', advance = 'NO') a(i, j)
		end do
		read(*, '(a1)') a(i, W)	
	end do
	do i = 0, H+1
		do j = 0, W
			write(*, '(a1)', advance = 'NO') a(i, j)
		end do
		write(*, '(a1)') a(i, W+1)	
	end do
end program main