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

li = []

for i in range(y):

    li.append(list(input()))

print('#'*(x+2))

for i in li:

    print('#', end = '')

    for k in i:

        print(k, end = '')

    print('#')



print('#'*(x+2))

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

li = []

for i in range(y):

    li.append(input())

print('#'*(x+2))

for i in li:

    print('#', end = '')

    print(i, end = '')

    print('#')



print('#'*(x+2))

y, x = map(int, input().split())
li = []
for i in range(y):
    li.append(list(input()))
print("#" * (x + 2))
for i in li:
    print("#", end="")
    for k in i:
        print(k, end="")
    print("#")
print("#" * (x + 2))

y, x = map(int, input().split())
li = []
for i in range(y):
    li.append(input())
print("#" * (x + 2))
for i in li:
    print("#", end="")
    print(i, end="")
    print("#")
print("#" * (x + 2))

-    li.append(list(input())) +    li.append(input()) -    for k in i: -        print(k, end="") +    print(i, end="")