Problem:


Score : 200 points

Problem Statement

You are given a image with a height of H pixels and a width of W pixels.
Each pixel is represented by a lowercase English letter.
The pixel at the i-th row from the top and j-th column from the left is a_{ij}.

Put a box around this image and output the result. The box should consist of # and have a thickness of 1.

Constraints

1 ≤ H, W ≤ 100

a_{ij} is a lowercase English letter.

Input

Input is given from Standard Input in the following format:

H W
a_{11} ... a_{1W}
:
a_{H1} ... a_{HW}

Output

Print the image surrounded by a box that consists of # and has a thickness of 1.

Sample Input 1

2 3
abc
arc

Sample Output 1

#####
#abc#
#arc#
#####

Sample Input 2

1 1
z

Sample Output 2

###
#z#
###



Sample input:
2 3
abc
arc


Sample output:
#####
#abc#
#arc#
#####

Submission status: Accepted

Solution code:

h,w = map(int,input().split())

ans = []
ans.append("#"*(w+2))
for i in range(h):
  s = input()
  tmp = "#"
  tmp += s
  tmp += "#"
  ans.append(tmp)
  

ans.append("#"*(w+2))
for i in ans:
  print(i)

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
print('#'*(w+2))
for i in range(h):
  s=input()
  print('#'+s+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
h, w = [int(item) for item in input().split()]
a = ["#" * (w+2)] + ["#" + input().rstrip() + "#" for _ in range(h)] + ["#" * (w+2)]
for item in a:
    print(item)

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    H,W = (int(_) for _ in input().split())
    ans = []
    ans.append('#'*(W+2))
    for i in range(H):
        a = input().rstrip()
        a = '#' + a + '#'
        ans.append(a)
    ans.append('#'*(W+2))
    print('\n'.join(ans))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N_list = [int(x) for x in input().split()]
char_list = []
for i in range(N_list[0]):
    char_list.append(input())
    
start_line = '#' * (N_list[1] + 2)
print(start_line)
for i in range(N_list[0]):
    print('#' + char_list[i] + '#')
print(start_line)

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
joubu=["#" for i in range(W+2)]
print("".join(joubu))
for i in range(H):
    S=input()
    print("#"+S+"#")
print("".join(joubu))

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
print("#"*(W+2))
for i in range(H):
    print("#"+input()+"#")
    
print("#"*(W+2))

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = [None for i in range(h + 2)]
a[0] = ['#' for i in range(w + 2)]
a[-1] = ['#' for i in range(w + 2)]
for i in range(1, h + 1):
    a[i] = ['#'] + list(input()) + ['#']

for i in range(h + 2):
    print(''.join(a[i]))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
print('#' * (W + 2))
for i in range(H):
    print('#' + input() + '#')
print('#' * (W + 2))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())

print("#" * (W + 2))
for i in range(0,H):
    print("#" + input() + "#")

print("#" * (W + 2))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
ORG = [input() for _ in range(H)]
EDGE = "#" * (W + 2)
print(EDGE)
for org in ORG:
	print("#" + org + "#")
print(EDGE)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
a = ["" for i in range(H)]
for i in range(H):
	a[i] = input()

print("#"*(W+2))
for i in range(H):
	print("#" + a[i] + "#")
print("#"*(W+2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
print('#'*(w+2))
for i in range(h):
  a=input()
  print('#'+a+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
import sys
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())

h, w = nm()
a = [['#'] + list(map(str, sys.stdin.readline().split())) + ['#'] for _ in range(h)]
a.insert(0, ['#' for _ in range(w + 2)])
a.append(['#' for _ in range(w + 2)])
for i in range(h + 2):
    print(''.join(a[i]))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
joubu = ["#" for i in range(W + 2)]
print("".join(joubu))
for i in range(H):
    S = input()
    print("#" + S + "#")
print("".join(joubu))

Submission status: Accepted

Solution code:
h, w = map(int, raw_input().split())
a = []
for i in range(h):
	tmp = '#' + str(raw_input()) + '#'
	a.append(tmp)
tmp1 = ['#' * (w + 2)]
a = tmp1 + a + tmp1
for i in range(h + 2):
	print a[i]

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
print('#'*(w+2))
for i in range(h):
    s = input()
    print('#'+s+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
ans = [["#" for i in range(w+2)] for i in range(h+2)]

a = [input() for i in range(h)]

for i in range(h):
    for j in range(w):
        ans[i+1][j+1] = a[i][j]

for i in range(h+2):
    for j in range(w+2):
        print(ans[i][j],end="")
    print()

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
print('#'*(W+2))
for _ in [0]*H:print('#'+input()+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    H, W = map(int, input().split())

    ud = '#' * (W+2)
    print(ud)
    for _ in range(H):
        a = input().strip()
        print('#' + a + '#')
    print(ud)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
s=[input() for i in range(h)]
print("#"*(w+2))
for i in range(h):
    print("#"+s[i]+"#")
print("#"*(w+2))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())

print('#'*(W+2))
for i in range(H):
    a = input()
    print('#'+a+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
h,w = map(int, input().split())

print('#'*(w+2))
for i in range(h):
    print('#', end='')
    print(input(), end='')
    print('#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
h,w,=map(int,input().split())
ss = [input() for _ in range(h)]
print('#'*(w+2))
for s in ss:
    print('#'+s+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
print('#'*(W+2))
for i in range(H):
	t=input()
	print('#'+t+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
hoge=[]
for i in range(h):
  hoge.append(input())

for i in range(w+2):
  print("#",end="")

print("")

for i in range(h):
  print("#",end="")
  print(hoge[i],end="")
  print("#")
  
for i in range(w+2):
  print("#",end="")

print("")

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
print("#"*(w+2))
for i in range(h):
    print("#"+input()+"#")
print("#"*(w+2))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
a = [input().split() for _ in range(H)]

for i in range(H+2):
    if 0 == i or H+1 == i:
        print('#' * (W+2))
    else:
        print('#' + a[i-1][0] + '#')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

h,w = map(int,input().split())
a = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    temp = list(input())
    for j in range(w):
        a[i][j] = temp[j]


for i in range(h):
    a[i] = ["#"] + a[i] + ["#"]

a = [["#" for i in range(w+2)]] + a + [["#" for i in range(w+2)]]

for i in range(h+2):
    a[i] = "".join(a[i])
    print(a[i])

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
s = []
for i in range(h):
    s.append("#"+input()+"#")
print("#"*(w+2))
for i in s:
    print(i)
print("#"*(w+2))

Submission status: Accepted

Solution code:
l = []

H, W = map(int, input().split())
l.append('#' * (W + 2))
for i in range(H):
    a = input()
    l.append('#' + a + '#')
l.append('#' * (W + 2))

print('\n'.join(l))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())

X=['#'*(w+2)]
for i in range(h):
    s=input()
    Y='#'+s+'#'
    X.append(Y)
X.append('#'*(w+2))

for i in range(h+2):
    print(X[i])

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
"""
x,y = LI()
f = [0,1,2,1,3,1,3,1,1,3,1,3,1]
if f[x] == f[y]:
    print("Yes")
else:
    print("No")
"""
#B
h,w = LI()
a = SR(h)
print("#"*(w+2))
for i in range(h):
    print("#",end = "")
    for j in a[i]:
        print(j,end = "")
    print("#")
print("#"*(w+2))

#C
"""
h,w = LI()
ans = float("inf")
x = w//2
y = h//2
if not w%2:
    for i in range(1,h):
        if (h-i)%2 == 0:
            ans = min(ans,abs(w*i-w*(h-i)//2))
        ans = min(ans,abs(w*i-x*(h-i)))
else:
    for i in range(1,h):
        if (h-i)%2 == 0:
            ans = min(ans,abs(w*i-w*(h-i)//2))
        if w*i < x*(h-i):
            ans = min(ans,abs(w*i-(x+1)*(h-i)))
        elif w*i < (x+1)*(h-i):
            ans = min(ans,h-i)
        else:
            ans = min(ans,abs(w*i-x*(h-i)))
if not h%2:
    for i in range(1,w):
        if (w-i)%2 == 0:
            ans = min(ans,abs(h*i-h*(w-i)//2))
        ans = min(ans,abs(h*i-y*(w-i)))
else:
    for i in range(1,w):
        if (w-i)%2 == 0:
            ans = min(ans,abs(h*i-h*(w-i)//2))
        if h*i < y*(w-i):
            ans = min(ans,abs(h*i-(y+1)*(w-i)))
        elif h*i < (y+1)*(w-i):
            ans = min(ans,w-i)
        else:
            ans = min(ans,abs(h*i-y*(w-i)))
print(ans)
"""

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

Solution code:
import collections

H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(input())

for i in range(H):
    a[i] = '#' + a[i] + '#'
    
border = '##'
for i in range(W):
    border += '#'

print(border)
for i in range(H):
    print(a[i])
print(border)

Submission status: Accepted

Solution code:
def picture_frame(H: int, W: int, A: list)->list:
    return ['#' * (W+2)] + ['#' + s + '#' for s in A] + ['#' * (W+2)]


if __name__ == "__main__":
    H = 0
    H, W = map(int, input().split())
    A = [input() for _ in range(H)]
    ans = picture_frame(H, W, A)
    print('\n'.join(ans))

Submission status: Accepted

Solution code:
H, W = list(map(int, input().split()))
A=[input() for _ in range(H)]

print('#'*(W+2))
for a in A:
  print('#'+a+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
h, w = [int(_) for _ in input().split()]
s = [input() for _ in range(h)]

print('#'*(w+2))
for c in s:
    print('#' + c + '#')
print('#'*(w+2))

Submission status: Accepted

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

for i in range(H + 2):
    if i == 0 or i == (H + 1):
        print("#" * (W + 2))
    else:
        print("#{}#".format("".join(list(map(str, input())))))

Submission status: Accepted

Solution code:
h,w = map(int, input().split())
listA = [input() for i in range(h)]
a = "#"*(w+2)
print(a)
for j in range(h):
  print("#"+listA[j]+"#")
print(a)

Submission status: Accepted

Solution code:
n, m = map(int, input().split())
p = ['#' * (m + 2)] + ['#' + input() + '#' for _ in range(n)] + ['#' * (m + 2)]
for r in p:
    print(r)

Submission status: Accepted

Solution code:
# 062 B
# import sys
# input = sys.stdin.readline

H,W= map(int,input().split())
f = [0] * (H + 2)
for i in range(H):
    block_ = "#"* (W+2)
    if i ==0:
        print(block_)
    x = input()
    x = "#"+ x +"#"
    print(x)
    if i == H-1:
        print(block_)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
A = []
for i in range(H):
    A.append(str(input()))
    
print("#" * (W+2))
for i in range(H):
    print("#"+A[i]+"#")
print("#" * (W+2))

Submission status: Accepted

Solution code:
a,s=map(int,input().split())
print("#"*(s+2))
for i in range(a):
  w=input()
  print("#"+w+"#")
print("#"*(s+2))

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
print("#"*(m+2))
for i in range(n):print("#"+input()+"#")
print("#"*(m+2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
ans=[]
ans.append(['#']*(w+2))
for i in range(h):
  a=list(input().split())
  a.insert(0,'#')
  a.append('#')
  ans.append(a)
ans.append(['#']*(w+2))
for i in ans:
  print(''.join(i))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
A = [input() for _ in range(H)]

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

for i in range(H):
    print('#' + A[i] + '#')

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

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
print("#"*(W+2))
[print("#" + input() + "#") for _ in range(H)]
print("#"*(W+2))

Submission status: Accepted

Solution code:
h,w = map(int,input().split())

l = [ ['#' + input() + '#'] for i in range(h)]

print('#'*(w+2))
for i in range(h):
	print(l[i][0])
print('#'*(w+2))

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
a = ['#'*(w+2)] + ['#'+input()+'#' for _ in range(h)] + ['#'*(w+2)]
for s in a:
    print(s)

Submission status: Accepted

Solution code:
H,W= map(int,input().split())
metric= []
metric.append("#"*(W+2))
for h in range(H):
    metric.append("#"+input()+"#")
metric.append("#"*(W+2))
for met in metric:
    print(met)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
a = [input() for i in range(H)]
block = '#' * (W+2)
print(block)
for s in a:
    print('#' + s + '#')
print('#' * (W+2))

Submission status: Accepted

Solution code:
H, W = list(map(int, input().split()))
A = [input() for i in range(H)]

header = ''
for _ in range(W+2):
    header += '#'

B = []
for i in range(H):
    B.append('#' + A[i] + '#')

print(header)
print(*B, sep="\n")
print(header)

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
str = '#' * (W+2)
print(str)
for _ in range(H):print('#'+input()+'#')
print(str)

Submission status: Accepted

Solution code:
H,W=map(int,input().split(' '))
print('#'*(W+2))
for i in range(H):
  print('#'+input()+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
h,w = (int(i) for i in input().split())
a = [input() for i in range(h)]

x = "#"*(w+2)
print(x)
for b in a:
    print("#"+b+"#")
print(x)

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
a=['#'*(w+2)]+['#'+input()+'#' for _ in range(h)]+['#'*(w+2)]
for x in a:
  print(x)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
a = [input() for _ in range(H)]

for i in range(H+2):
    if i == 0 or i == H+1:
        print("#"*(W+2))
    else:
        print("#"+a[i-1]+"#")

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
print("#"*(W+2))
for _ in range(H):
    a = input()
    print("#" + a + "#")
print("#"*(W+2))

Submission status: Accepted

Solution code:
_,w,*s=open(0).read().split();t=['#'*(int(w)+2)];a=t+['#'+t+'#'for t in s]+t;print(*a)

Submission status: Accepted

Solution code:
h,w = map(int, input().split())
a_list = [list(input()) for _ in range(h)]

for a in a_list:
    a.insert(0,'#')
    a.append('#')
a_list.insert(0,['#']*(w+2))
a_list.append(['#']*(w+2))

for a in a_list:
    print(''.join(a))

Submission status: Accepted

Solution code:
def main():
    H, W = map(int, input().split())
    print("#" * (W+2))
    for _ in range(H):
        print("#" + input() + "#")
    print("#" * (W+2))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
h,w = map(int, input().split())
ans = [['#']*(w+2)]+[list('#'+input()+'#') for i in range(h)]+[['#']*(w+2)]
for i in ans:
    print(''.join(i))

Submission status: Accepted

Solution code:
H, W = [ int(x) for x in input().split() ]
a_s = [ input() for _ in range(H) ]

ans = ""
for i in range(W + 2):
    ans += "#"
ans += "\n"
for a in a_s:
    ans += "#" + a + "#"
    ans += "\n"
for i in range(W + 2):
    ans += "#"

print(ans)

Submission status: Accepted

Solution code:
H, W = map(int,input().split())

result = ["#"*(W+2)]
for _ in range(H):
  c = input()
  result.append("#"+c+"#")
result.append("#"*(W+2))
print("\n".join(result))

Submission status: Accepted

Solution code:
H, W = map(int,input().split())
a = [list(str(input())) for i in range(H)]
for i in range(0,H,1):
  a[i].insert(0,"#")
  a[i].insert(W+1,"#")
print("#"*(W+2))
for i in range(H):
  print(''.join(map(str, a[i])))
print("#"*(W+2))

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)

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

grid = [["#"]*(W+2) for _ in range(H+2)]

for i in range(1, H+1):
    for j, c in enumerate(input()):
        grid[i][j+1] = c

for i in grid:
    print("".join(i))

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
A = [input() for i in range(h)]
print('#'*(w+2))
for a in A:
    print('#'+a+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
h, w = map(int, input().split())

a = ['#' + input() + '#' for _ in range(h)]


a = ['#' * (w + 2)] + a + ['#' * (w + 2)]

for s in a: print(s)

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
ans=["#"*(w+2)]
for i in range(h):
    s=input()
    ans.append("#"+s+"#")
ans.append("#"*(w+2))
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
""" AtCoder """

H, W = map(int, input().split())
a = ['#' + input() + '#' for _ in range(H)]

print('#' * W + "##")
for i in range(H):
    print(a[i])
print('#' * W + "##")

Submission status: Accepted

Solution code:
h,w=[int(i) for i in input().split()]
text=""
for i in range(w+2):
    text+="#"
for i in range(h):
    text+="\n#"+input()+"#"
text+="\n"
for i in range(w+2):
    text+="#"
print(text)

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = "#" * (w+2)
x = [a]

for _ in range(h):
    A = input()
    A = "#" + A + "#"
    x.append(A)

x.append(a)

for i in range(h+2):
    print(x[i])

Submission status: Accepted

Solution code:
H,W=map(int,input().split())
print("#"*(W+2))
for _ in range(H):print("#"+input()+"#")
print("#"*(W+2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
a=[input() for i in range(h)]
print('#'*(w+2))
for i in range(h):
	print('#'+a[i]+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())

print('#'*(W+2))
for i in range(H):
  str = input()
  print('#'+str+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
# coding: utf-8
H, W = map(int, input().split())
pic = [['#' for _ in range(W + 2)] for _ in range(H + 2)]
for i in range(H):
    for j, k in enumerate(list(input())):
        pic[i + 1][j + 1] = k
for i in pic:
    print(''.join(i))

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("yes")
    else:print("no")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
h,w= (int(i) for i in input().split())      #入力整数横2つ
#n,x,y = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
a=[input() for i in range(h)]
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
c = []
e = ["#" for i in range(w+2)]
c.append(''.join(e))
for i in range(h):
    d = ["#",a[i],"#"]
    c.append(''.join(d))
e = ["#" for i in range(w+2)]
c.append(''.join(e))
for  i in range(h+2):
    print(c[i])

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
a="#"*(w+2)
print(a)
for i in range(h):
    s=input()
    print("#{}#".format(s))
print(a)

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
a = [input() for _ in range(H)]

print("#"*(W+2))
for i in range(H):
    print("#"+a[i]+"#")
print("#"*(W+2))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())

print('#'*(W+2))
for i in range(H):
  a = input()
  print('#'+a+'#')
print('#'*(W+2))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
_input = []
for i in range(H):
    row = list(map(str,input().split()))
    row = '#' + row[0] + '#'
    _input.append(row)

for i in range(H+2):
    if i == 0 or i == H+1:
        for j in range(W+2):
            if j == W+1:
                print('#')
            else:
                print('#',end='')
    else:
        print(_input[i-1])

Submission status: Accepted

Solution code:
h,w = map(int, input().split())
aa = [input() for _ in range(h)]

print('#'*(w+2))
for a in aa:
    print('#{}#'.format(a))
print('#'*(w+2))

Submission status: Accepted

Solution code:
_,w,*s=open(0).read().split();t=['#'*(int(w)+2)];a=t+['#'+t+'#'for t in s]+t;print(*a,sep='\n')

Submission status: Accepted

Solution code:
h,w =map(int,input().split())

print("#"*(w+2))
for _ in range(h):
  print("#"+input()+"#")
print("#"*(w+2))

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = [input() for _ in range(h)]
print("#"*(w+2))
for i in range(h):
    print("#"+a[i]+"#")
print("#"*(w+2))

Submission status: Accepted

Solution code:
H, W = list(map(int, input().split()))
print('#' * (W+2))
for i in range(H):
    a = '#' + input() + '#'
    print(a)
print('#' * (W+2))

Submission status: Accepted

Solution code:
H, W = map(int, raw_input().split())
a = [raw_input() for _ in range(H)]

print "#"*(W+2)
for t in a:
  print "#"+t+"#"
print "#"*(W+2)

Submission status: Accepted

Solution code:
H, W = map(int,input().split())
A = ['#' + input() + '#' for _ in range(H)]
result = []
result.append('#' * (W+2))
for a in A:
  result.append(a)
result.append('#' * (W+2))
for r in result:
  print(r)

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    s="#"+input()+"#"
    print(s)
print("#"*(w+2))

Submission status: Accepted

Solution code:
H, W = [int(x) for x in input().split()]

print('#' * (W + 2))
for i in range(H):
  print('#' + input() + '#')
print('#' * (W + 2))

Submission status: Accepted

Solution code:
h, w = list(map(int, input().split()))

bo = '#' * (w + 2)
print(bo)
for _ in range(h):
    aa = '#' + input() + '#'
    print(aa)
print(bo)

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = [list(input()) for i in range(h)]
a = [['#' for i in range(w)]] + a + [['#' for i in range(w)]]
for i in range(h+2):
    a[i] = ['#']+ a[i] +['#']
    print(''.join(a[i]))

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = [['#']*(w+2) for _ in [0]*(h+2)]
print(''.join(a[0]))
for x in range(1, h+1):
    line = input().rstrip()
    a[x][1:w+1] = line
    print(''.join(a[x]))
print(''.join(a[h+1]))

Submission status: Accepted

Solution code:
h,w = map(int,input().split())
A = []
for i in range(h):
    A.append("#"+input()+"#")

print("#"*(w+2))
for i in A:
    print(i)
print("#"*(w+2))

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
print('#'*(w+2))
for i in range(h):
  a = str(input())
  print('#'+a+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
b = []
for i in range(h):
    b.append(input())
    
for i in range(h+2):
    for j in range(w+2):
        if j==w+1:
            print('#')
        elif i==0 or i==h+1:
            print('#',end='')
        elif j==0:
            print('#',end='')
        else:
            print(b[i-1][j-1],end='')

Submission status: Accepted

Solution code:
H, W = map(int, input().split())

sh = '#'

print(sh * (W + 2))

for i in range(H):
    print(sh + input() + sh)

print(sh * (W + 2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
for s in range(h):
  if s==0:
    print("#"*(w+2))
  print("#"+input()+"#")
  if s==h-1:
    print("#"*(w+2))

Submission status: Accepted

Solution code:
H,W = map(int, input().split())
ans = []
ans.append('#'*(W+2))
for i in range(H):
    ans.append('#'+input()+'#')
ans.append('#'*(W+2))
for i in range(H+2):
    print(ans[i])

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
h , w = map(int, input().split())
pic = []

for i in range(h):
    temp = input()
    pic.append(temp)

li = '#' * (w+2)

print(li)

for j in range(h):
    temp = '#' + pic[j] + '#'
    print(temp)

print(li)


if __name__ == '__main__':
    pass

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
A=[]
for i in range(a):
  A.append("#"+input()+"#")
print("#"*(b+2))
for i in range(a):
  print(A[i])
print("#"*(b+2))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
list=[]
a=[[b for b in input()] for _ in range(h)]
for i in range(w):
    list.append('#')
a.insert(0,list)
a.append(list)
for j in range(len(a)):
    a[j].insert(0,'#')
    a[j].append('#')
for k in range(len(a)):
    for l in range(w+2):
        print(a[k][l],end="")
    print('')

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
A = [[a for a in input()] for _ in range(H)]
Sharps = [ ['#' for i in range(W+2)]for _ in range(H + 2)]
for i in range(1,H+1):
    for j in range(1,W+1):
        Sharps[i][j]=A[i-1][j-1]


for i in Sharps:
    print('.'.join(i).replace('.',''))

Submission status: Accepted

Solution code:
h,w=map(int,input().split())
lst=[]
for i in range(h):
    lst.append(input())
for i in range(h+2):
    if i==0 or i==h+1:
        print('#'*(w+2))
    else:
        print('#'+str(lst[i-1])+'#')

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
ans = []
blank = ['#' for _ in range(y+2)]

ans.append(blank)
for _ in range(x):
    l =['#'] + list(input()) +['#']
    ans.append(l)
ans.append(blank)

for x in ans:
    for y in x:
        print(y,end='')
    print()

Submission status: Accepted

Solution code:
h,w = map(int, input().split())
a = []
for _ in range(h):
    a.append(input())

for i in range(w+2):
    print("#",end="")
print()
geta = "#"
for i in range(h):
    print("{}{}{}".format(geta,a[i],geta),end="")
    print()
for i in range(w+2):
    print("#",end="")

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = [input() for _ in range(h)]

print("#"*(w+2))
for i in range(h):
    print("#"+a[i]+"#")
print("#"*(w+2))

Submission status: Accepted

Solution code:
def func():
    pass


def main():
    h, w = map(int, input().split())
    p = []
    for i in range(h):
        s = input()
        p.append(s)

    print("#" * (w + 2))
    for pi in p:
        print("#" + pi + "#")
    print("#" * (w + 2))



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
h,w = (input().split())
h,w = int(h), int(w)

print('#'*(w+2))
for i in range(h):
    s = input()
    print('#{}#'.format(s))

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

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
a = ['#'*(w+2)]
for _ in range(h):
    a_w = '#' + input() + '#'
    a.append(a_w)

a.append('#'*(w+2))

for i in a:
    print(i)

Submission status: Accepted

Solution code:
h, m = map(int, input().split())
C = [input() for i in range(h)]

hana = '#' * (m + 2)
print(hana)
for i in range(h):
    print('#' + C[i] + '#')
print(hana)

Submission status: Accepted

Solution code:
h,w=(int(i) for i in input().split())
#print(h,w)

print('#'*(w+2))
for i in range(h):
  print('#'+input()+'#')
print('#'*(w+2))

Submission status: Accepted

Solution code:
h, w=map(int, input().split())
arr=["#" + input() + "#" for i in range(h)]
print("#"*(w+2))
for i in arr:
  print(i)
print("#"*(w+2))

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
print("#"*(W+2))
for i in range(H):
  row = input()
  print("#"+row+"#")
print("#"*(W+2))

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
sharp = '#' * (w + 2)
print(sharp)
for i in range(h):
  print('#' + input() + '#')
print(sharp)

Submission status: Accepted

Solution code:
line = input().split(" ")
h = int(line[0])
w = int(line[1])
arr =[]
for i in range(h):
    arr.append(input())

for i in range(w+2):
    print("#", end="")
print()

for i in arr:
    print("#"+i+"#")

for i in range(w+2):
    print("#", end="")
print()

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
A = []
for i in range(N):
    A.append(str(input()))
print("#"*(M+2))
for i in range(N):
   print("#"+A[i]+"#")
print("#"*(M+2))

Submission status: Accepted

Solution code:
# ABC 062
import math
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def getIntFromRows(n): return [int(input()) for i in range(n)]
def getIntMat(n):
    mat = []
    for i in range(n): mat.append(getIntList())
    return mat

def zeros(n): return [0 for i in range(n)]
def zeros2(n, m): return [[0 for i in range(m)] for j in range(n)]
N1097 = 10**9 + 7 
debug = True
def db(x): 
    if debug: print(x)

debug = True
h,w = getIntList()
a = ['#'*(w+2)]
for i in range(h):
    a.append('#'+input()+'#')
a.append('#'*(w+2))
for i in range(h+2):
    print(a[i])

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=["#"+input()+"#"for i in range(a)]
s=["#"*(b+2)]+s+["#"*(b+2)]
for i in range(a+2):
    print(s[i])

Submission status: Accepted

Solution code:
h,w = (int(i) for i in input().split())
sharp = "#" * (w+2)
print(sharp)
for i in range (h):
 ans = input()
 output = '#'+ans+'#'
 print(output)
print(sharp)

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
S = [input() for _ in range(H)]

print("#"*(W+2))
for i in range(H):
    print("#"+ S[i] +"#")
print("#"*(W+2))

Submission status: Accepted

Solution code:
H, W = map(int, input().split())
a = [0 for _ in range(H)]
for i in range(H):
    a[i] = list(map(str, input().split()))
    a[i].insert(0, '#')
    a[i].append('#')
line = ['#'] * (W + 2)
print(''.join(line))
for i in range(H):
    print(''.join(a[i]))
print(''.join(line))

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
print("#"*(M+2))
for i in range(N):
    print("#"+str(input())+"#")
print("#"*(M+2))