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

A = [input().strip() for _ in range(H)]

A.insert(0,"#"*(W+2))

for i in range(1,H+1):

    A[i] = "#"+A[i]+"#"

A.append("#"*(W+2))

for i in range(H+2):

    print((A[i]))
H,W = list(map(int,input().split()))

x = ["#"*(W+2)]

for _ in range(H):

    a = input().strip()

    a = "#"+a+"#"

    x.append(a)

x.append("#"*(W+2))

for i in range(H+2):

    print((x[i]))
H, W = list(map(int, input().split()))
A = [input().strip() for _ in range(H)]
A.insert(0, "#" * (W + 2))
for i in range(1, H + 1):
    A[i] = "#" + A[i] + "#"
A.append("#" * (W + 2))
for i in range(H + 2):
    print((A[i]))

H, W = list(map(int, input().split()))
x = ["#" * (W + 2)]
for _ in range(H):
    a = input().strip()
    a = "#" + a + "#"
    x.append(a)
x.append("#" * (W + 2))
for i in range(H + 2):
    print((x[i]))

-A = [input().strip() for _ in range(H)] -A.insert(0, "#" * (W + 2)) -for i in range(1, H + 1): -    A[i] = "#" + A[i] + "#" -A.append("#" * (W + 2)) +x = ["#" * (W + 2)] +for _ in range(H): +    a = input().strip() +    a = "#" + a + "#" +    x.append(a) +x.append("#" * (W + 2)) -    print((A[i])) +    print((x[i]))