program ABC062B
    implicit none
    integer(8)::H,W,i
    character(100),dimension(100)::A
    read(5,*)H,W
    read(5,*)(A(i),i=1,H)

    do i=1,W+2
        write(*,'(A)',advance='no')"#"
    end do
    print'(A)',""

    do i=1,H
        write(*,'(A)',advance='no')"#"
        write(*,'(A)',advance='no')A(i)(1:W)
        write(*,'(A)',advance='no')"#"
        print'(A)',""
    end do

    do i=1,W+2
        write(*,'(A)',advance='no')"#"
    end do
    print'(A)',""
end program ABC062B