y,x = list(map(int,input().split()))

str = [["#" for i in range(x+2)]for i in range(y+2)]

a = [0 for i in range(y)]

for i in range(y):

    a[i] = eval(input())

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

    for z in range(1,x+1):

        check = a[i-1]

        str[i][z] = a[i-1][z-1]



for i in range(y+2):

    print(("".join(str[i])))
h, w = map(int,input().split())

s = ["#"+input()+"#" for _ in range(h)]

s = ["#"*(w+2)]+s+["#"*(w+2)]

print(*s,sep="\n")

y, x = list(map(int, input().split()))
str = [["#" for i in range(x + 2)] for i in range(y + 2)]
a = [0 for i in range(y)]
for i in range(y):
    a[i] = eval(input())
for i in range(1, y + 1):
    for z in range(1, x + 1):
        check = a[i - 1]
        str[i][z] = a[i - 1][z - 1]
for i in range(y + 2):
    print(("".join(str[i])))

h, w = map(int, input().split())
s = ["#" + input() + "#" for _ in range(h)]
s = ["#" * (w + 2)] + s + ["#" * (w + 2)]
print(*s, sep="\n")

-y, x = list(map(int, input().split())) -str = [["#" for i in range(x + 2)] for i in range(y + 2)] -a = [0 for i in range(y)] -for i in range(y): -    a[i] = eval(input()) -for i in range(1, y + 1): -    for z in range(1, x + 1): -        check = a[i - 1] -        str[i][z] = a[i - 1][z - 1] -for i in range(y + 2): -    print(("".join(str[i]))) +h, w = map(int, input().split()) +s = ["#" + input() + "#" for _ in range(h)] +s = ["#" * (w + 2)] + s + ["#" * (w + 2)] +print(*s, sep="\n")