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

mark_list = [["#"]*(W+2) for i in range(H+2)]

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

  w_list = input()

  for j in range(1,W+1):

    mark_list[i][j] = w_list[j-1]



# output

for i in mark_list[0]:

  print(i, end="")

print("")

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

  for j in range(W+2):

    print(mark_list[i][j], end="")

  print("")

for i in mark_list[H+1]:

  print(i, end="")

    

# Problem B - Picture Frame



# input

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

a_list = [['']*W for i in range(H)]

for i in range(H):

    a_nums = list(eval(input()))

    for j in range(W):

        a_list[i][j] = a_nums[j]



# output

ans = "#"*(W+2)

ans += "\n"

for i in range(H):

    ans += "#"

    for j in range(W):

        ans += a_list[i][j]

    ans += "#\n"

ans += "#"*(W+2)

print(ans)

H, W = map(int, input().split())
mark_list = [["#"] * (W + 2) for i in range(H + 2)]
for i in range(1, H + 1):
    w_list = input()
    for j in range(1, W + 1):
        mark_list[i][j] = w_list[j - 1]
# output
for i in mark_list[0]:
    print(i, end="")
print("")
for i in range(1, H + 1):
    for j in range(W + 2):
        print(mark_list[i][j], end="")
    print("")
for i in mark_list[H + 1]:
    print(i, end="")

# Problem B - Picture Frame
# input
H, W = list(map(int, input().split()))
a_list = [[""] * W for i in range(H)]
for i in range(H):
    a_nums = list(eval(input()))
    for j in range(W):
        a_list[i][j] = a_nums[j]
# output
ans = "#" * (W + 2)
ans += "\n"
for i in range(H):
    ans += "#"
    for j in range(W):
        ans += a_list[i][j]
    ans += "#\n"
ans += "#" * (W + 2)
print(ans)

-H, W = map(int, input().split()) -mark_list = [["#"] * (W + 2) for i in range(H + 2)] -for i in range(1, H + 1): -    w_list = input() -    for j in range(1, W + 1): -        mark_list[i][j] = w_list[j - 1] +# Problem B - Picture Frame +# input +H, W = list(map(int, input().split())) +a_list = [[""] * W for i in range(H)] +for i in range(H): +    a_nums = list(eval(input())) +    for j in range(W): +        a_list[i][j] = a_nums[j] -for i in mark_list[0]: -    print(i, end="") -print("") -for i in range(1, H + 1): -    for j in range(W + 2): -        print(mark_list[i][j], end="") -    print("") -for i in mark_list[H + 1]: -    print(i, end="") +ans = "#" * (W + 2) +ans += "\n" +for i in range(H): +    ans += "#" +    for j in range(W): +        ans += a_list[i][j] +    ans += "#\n" +ans += "#" * (W + 2) +print(ans)