h, w = map(int, input().split())
#inputの両端に.を入れてリストに格納
ls = [[i for i in '.'+input()+'.'] for i in range(h)]
print(ls)
#上段を埋める
ls.insert(0, ['.' for i in range(w+2)])
print(ls)
#下段を埋める
ls.append(['.' for i in range(w+2)])
print(ls)

for i in range(len(ls)):
    print(ls[i])