from collections import deque 

H,W = list(map(int,input().split()))

st = [str(eval(input())) for _ in range(H)]

#print(st)

st = deque(st)

for i in range(H):

    st[i] = '#'+st[i]+'#'

st.appendleft('#'*(W+2))

st.append('#'*(W+2))



for i in range(H+2):

    print((st[i]))


H,W = map(int,input().split())

st = ['#' + str(input()) +'#' for _ in range(H)]

st = ['#'*(W+2)] + st + ['#'*(W+2)]

print(*st,sep='\n')

from collections import deque

H, W = list(map(int, input().split()))
st = [str(eval(input())) for _ in range(H)]
# print(st)
st = deque(st)
for i in range(H):
    st[i] = "#" + st[i] + "#"
st.appendleft("#" * (W + 2))
st.append("#" * (W + 2))
for i in range(H + 2):
    print((st[i]))

H, W = map(int, input().split())
st = ["#" + str(input()) + "#" for _ in range(H)]
st = ["#" * (W + 2)] + st + ["#" * (W + 2)]
print(*st, sep="\n")

-from collections import deque - -H, W = list(map(int, input().split())) -st = [str(eval(input())) for _ in range(H)] -# print(st) -st = deque(st) -for i in range(H): -    st[i] = "#" + st[i] + "#" -st.appendleft("#" * (W + 2)) -st.append("#" * (W + 2)) -for i in range(H + 2): -    print((st[i])) +H, W = map(int, input().split()) +st = ["#" + str(input()) + "#" for _ in range(H)] +st = ["#" * (W + 2)] + st + ["#" * (W + 2)] +print(*st, sep="\n")