Option Infer On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim H As Integer = NextInt()
        Dim W As Integer = NextInt()

        Dim a As String() = New String(H - 1) {}
        For i = 0 To H - 1
            a(i) = ReadLine()
        Next

        For i = 0 To H + 1
            Write("#")
            If i = 0 OrElse i = H + 1 Then
                Write(New String("#"c, W))
            Else
                Write(a(i - 1))
            End If
            WriteLine("#")
        Next
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
