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:
hw = [int(x) for x in input().split()]
h  = hw[0]
w = hw[1]
print("#"*(w+2))
for i in range(h):
    pic = input()
    print("#"+ pic+ "#")
print("#"*(w+2))

Submission status: Accepted

Solution code:

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

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

for _ in range(H):
    s = input()
    print("#", s, "#", sep="")

print(s0)

Submission status: Accepted

Solution code:
hw = [int(n) for n in input().split()]

for i in range(hw[0]):
    a = [moji for moji in input().split()]
    a.insert(0, '#')
    a.append('#')
    if i == 0:
        print('#' * (hw[1] + 2))
    print(''.join(a))

print('#' * (hw[1] + 2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
tmp_n = n.split(" ")

h = int(tmp_n[0])
w = int(tmp_n[1])
in_list = []

for i in range(h):
    in_pixel = input()
    in_list.append(in_pixel)

print("#"*(w+2))
for j in in_list:
    print("#"+j+"#")
print("#"*(w+2))

Submission status: Accepted

Solution code:
def output(out):
    for i in out:
        for j in i:
            print(j, end='')
        print()
    return

def func(H, W):
    out = ['' for i in range(H+2)]
    b = ['#' for j in range(W+2)]
    out[0] = b
    for i in range(H):
        s = input()
        out[i+1] = ['#'] + list(s) + ['#']
    out[-1] = b
    return out

s = input().split(' ')
H = int(s[0])
W = int(s[1])
out = func(H, W)
output(out)

Submission status: Accepted

Solution code:
import sys
import random

def rd():
        return sys.stdin.readline().rstrip()

def rdi():
        return [ int(x) for x in rd().split() ]

H, W = rdi()
print "#" * (W+2)
for i in range(H):
        s = rd()
        print "#" + s + "#"
print "#" * (W+2)

Submission status: Accepted

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

pict = []
for i in range(H):
    row = input()
    pict.append(row)

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

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:
h, w = map(int, raw_input().split())

print '#'*(w+2)
for _ in xrange(h):
    print '#' + raw_input() + '#'
print '#'*(w+2)

Submission status: Accepted

Solution code:
H, W = list(map(int, input().split(' ')))
lst = []

for h in range(H):
  lst.append(input())


print('#'*(W+2))
for s in lst:
  print('#{}#'.format(s))
print('#'*(W+2))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

s = []
for i in range(a):
    s.append(input())

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#!/bin/python3

import sys

h,w = map(int, input().strip().split(' '))
top_frame = "##" + "#" * w
print(top_frame)
for i in range(h):
    image_row = "#" + input().strip() + "#"
    print(image_row)
print(top_frame)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
H, W = map(int, raw_input().split())

print "".join(["#"] * (W + 2))

for i in xrange(H):
    print "#" + raw_input() + "#"

print "".join(["#"] * (W + 2))

Submission status: Accepted

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

pic = [["#" for i in range(w + 2)] for j in range(h + 2)]
for i in range(h):
    for j in range(w):
        pic[i + 1][j + 1] = pic0[i][j]

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

Submission status: Accepted

Solution code:

# coding: utf-8

if __name__ == "__main__":

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
H, W = [int(n) for n in input().split()]
A = []

for h in range(H):
    A.append([str(n) for n in input().split()])

result = "#" * (W+2) 
for a in A:
    result += "\n#{}#".format("".join(a))
result += "\n"+"#" * (W+2)
print(result)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
h,w = map(int,input().split())
arr = []
for i in range(h):
    arr.append(input())


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

for i in range(h):
    print('#',sep = '',end = '')
    print(arr[i],sep = '',end = '')
    print('#')

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

Submission status: Accepted

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

output = []
output.append('#'*(W+2))

for _ in range(H):
    pics = '#{}#'.format(input())
    output.append(pics)

output.append('#'*(W+2))

for pics in output:
    print(pics)

Submission status: Accepted

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

image = []
for i in range(H):
    image.append(input())

framed_image = []
for i in range(H+2):
    if i == 0 or i == H+1:
        framed_image.append("#"*(W+2))
    else:
        framed_image.append("#"+image[0]+"#")
        del image[0]

for line in framed_image:
    print(line)

Submission status: Accepted

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

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

Submission status: Accepted

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

mp.append(["#"]*(W+2))

for idx in range(H+2):
    print "".join(mp[idx])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs = [int(x) for x in input().split(" ")]

H = inputs[0]
W = inputs[1]

strs = [input() for _ in range(H)]

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

for s in strs:
	print("#" + s + "#")

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

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 range(H):
	print('#' + a[i] + '#')
print('#' * (W + 2))

Submission status: Accepted

Solution code:
H,W=map(int,raw_input().split())
pic=[]
for i in range(H):
    pic.append('#'+raw_input()+'#')
pic.insert(0,'#'*len(pic[0]))
pic.append('#'*len(pic[0]))
for i in pic:
    print i

Submission status: Accepted

Solution code:
def rren(): return list(map(int, input().split()))


H, W = rren()
a = ""
for i in range(W+2):
    a += "#"
print(a)
for i in range(H):
    print("#"+input()+"#")
print(a)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

sets = [
    set([1,3,5,7,8,10,12]),
    set([4,6,9,11]),
    set([2])
]

def find_group(i):
    for index, group in enumerate(sets):
        if i in group:
            return index


H,W = map(int, sys.stdin.readline().rstrip().split())
print("#"*(W+2))
for _ in range(H):
    print("#"+sys.stdin.readline().rstrip()+"#")
print("#"*(W+2))

exit(0)

Submission status: Accepted

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

for i in range(H):
	L.append(input().split())

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

for i in range(H):
	print("#", end = "")
	print("".join(L[i]), end = "")
	print("#")

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

Submission status: Accepted

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

str = ""
for j in range(w+2):
    str += "#"
print(str)
for k in range(h):
    print("#"+l[k]+"#")
print(str)

Submission status: Accepted

Solution code:
hw = list(map(int, input().split()))
h = hw[0]
w = hw[1]

img = list()
for i in range(h):
    img.append(input())

print("#"*(w+2));
for row in img:
    print("#"+row+"#")
    
print("#"*(w+2));

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W = map(int,raw_input().split(' '))
print "#"*(W+2)
for _ in xrange(H):
    s = raw_input()
    print "#"+s+"#"
print "#"*(W+2)

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-

import sys
import os

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

A = []
for i in range(H):
    A.append(input().strip())

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

Submission status: Accepted

Solution code:
h, w = [int(i) for i in raw_input().split()]
print('#' * (w + 2))
for v in [raw_input() for i in range(h)]:
    print('#%s#' % v)
print('#' * (w + 2))

Submission status: Accepted

Solution code:
x, y = map(int, raw_input().split())

print "#" * (y + 2)

for i in range(x):
	a = raw_input()
	print "#" + a + "#"

print "#" * (y + 2)

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
h,w=map(int,input().split())
data=['#'*(w+2)]
for i in range(h):
    data.append('#'+input()+"#")
data.append('#'*(w+2))
print('\n'.join(data))

Submission status: Accepted

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

h,w = map(int, raw_input().split())
sharp = ''

for i in range(w+2):
    sharp += '#' 
print(sharp)
for i in range(h):
    print('#'+raw_input()+'#')
print(sharp)

Submission status: Accepted

Solution code:
#!/usr/bin/env python


def read():
    row, col = map(int, raw_input().split())
    b = []
    for i in range(row):
        b.append(raw_input())
    return b


def work(b):
    print "#" * (len(b[0]) + 2)
    for line in b:
            print "#" + line + "#"
    print "#" * (len(b[0]) + 2)
   

if __name__ == "__main__":
    work(read())

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
for i in range(h):
    for j in range(w):
        a=list(input())

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

Submission status: Runtime Error

Solution code:
x,y=input().split()
x=int(x)
y=int(y)
a=[input() for i in range(x)]
c=""
for i in range(y+2):
  c=c+"#"
print(c)
for i in range(y-1):
  print("#"+a[i]+"#")
print(c)

Submission status: Runtime Error

Solution code:
x,y=input().split()
x=int(x)
y=int(y)
a=[input() for i in range(x)]
c=""
for i in range(y):
  c=c+"#"
print(c)
for i in range(y):
  print("#"+a[i]+"#")
print(c)

Submission status: Runtime Error

Solution code:
a=[input() for i in range]
c=""
for i in range(len(a[0])+2):
  c=c+"#"
print(c)
for i in range(len(a[0]+2):
  print("#"+a[i]+"#")
print(c)

Submission status: Runtime Error

Solution code:
using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
      string[] input = ReadLine().Split();
      int h = int.Parse(input[0]);
      int w = int.Parse(input[1]);
      List<List<string>> a = new List<List<string>>();
      List<string> slis = new List<string>();
      
      string s = "";
      for (int i=0;i<w+2;i++)
      {
        s+="#";
      }
      
      a.Add(s.ToList().ConvertAll(x=>x.ToString()));
      
      for (int i=0;i<h;i++)
      {
        slis.Clear();
        slis.Add("#");
        slis.AddRange(ReadLine().ToList().ConvertAll(x=>x.ToString()));
        slis.Add("#");
        a.Add(slis);
      }
      
      a.Add(s.ToList().ConvertAll(x=>x.ToString()));
      
      foreach (var i in a)
      {
        WriteLine(string.Join("",i));
      }
    }
}

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
for i in range(x+1):
    print("#",end = "")
print("#")
for i in range(y):
    print("#"+input()+"#")
for i in range(x+1):
    print("#",end = "")
print("#")

Submission status: Runtime Error

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

Submission status: Runtime Error

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


for i in range(W+2):
    print("#",end = "")
print("")
for i in a:
    print("#",l,"#",sep = "")
for i in range(W+2):
    print("#",end = "")

Submission status: Runtime Error

Solution code:
hw,*aaa = open(1).read().splitlines()

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

print('#'*(w+2))
for aa in aaa:
    print(f'#{aa}#')
print('#'*(w+2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = []
b = list([['#']*(w+2)]*(h+2)) #[]で囲うことが重要


for i in range(h):
    a.append(list(input())) #splitを入れなければOK

for j in range(h):
    for k in range(w):
    b[j+1][k+1] = a[j][k]

print(b)

Submission status: Runtime Error

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

a = []
b = list([['#']*(w+2)]*(h+2)) #[]で囲うことが重要


for i in range(h):
    a.append(list(input())) #splitを入れなければOK

for j in range(h):
    for k in range(w)
    b[j+1][k+1] = a[j][k]

print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
h, w  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

Submission status: Runtime Error

Solution code:
h,w=input().split()
h=int(h)
ch='#'
w=int(w)
lt=[]
for i in range(h):
    a = []
    a.append(input().split())
    lt.append(a)
for j in range(w+2):
    print(ch,end=' ')
print()
for i in range(h):
    for j in range(w):
        if j==0:
            print(ch,end=' ')
        print(lt[i][0][j],end=' ')
        if j==w-1:
            print(ch,end=' ')
    print()
for j in range(w+2):
    print(ch,end=' ')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w=map(int,input().rstrip().split(' '))
A = list()
a = "#"*(W+2)
A.append(a)
for i in range(h):
  a = str(input().rstrip())
  a = "#"+a+"#"
  A.append(a)

a = "#"*(W+2)
A.append(a)
for a in A:
  print(a)

Submission status: Runtime Error

Solution code:

n,m=map(int,input().split())
# print
v=[]
for i in range(n+2):
    s=""
    if i==0 or i==n+1:
        s="#"*(m+2)
        
    else:
        a=input()
        s="#"+a+"#"
    v.append(s)
    
    
for i in v:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = []
ans.append(['#'*(W+2)])
for row in a:
    row.insert(0, '#')
    row.append('#')
    ans.append(row)
ans.append(['#'*(W+2)])
for i in range(W+2):
    print(*ans[i], sep='')

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(h+2):
  if i == 0 or i == h+1:
    print("#"*(w+2))
  else:
    print("#"+input()"#")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
L=[list(map(str,input())) for i in rage(a)]
L.insert(0,[*]*(a+2))])
L.insert(-1,[*]*(a+2))])
for i in L
print("".join(i))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
a=input()
b=input()
print("#"*(h+w))
print("#"+a+"#")
print("#"+b+"#")
print("#"*(h+w))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H, W = input().split(' ')
H=int(H)
W=int(W)
lista=[]
pos=0
for lis in range(0,H):
    a = input()
    lista.append(a)
print ((W+2)*"#")
if H==1:
    print('#'+lista[pos]+'#')
else:
    for linha in range (0,W-1):
        print ('#'+lista[pos]+'#')
        pos+=1
print ((W+2)*'#')

Submission status: Runtime Error

Solution code:
H, W = input().split(' ')
H=int(H)
W=int(W)
lista=[]
pos=0
for lis in range(0,H):
    string = input()
    lista.append(string)
print ((W+2)*"#")
if H==1:
    print('#'+lista[pos]+'#')
else:
    for linha in range (0,W-1):
        print ('#'+lista[pos]+'#')
        pos+=1
print ((W+2)*'#')

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

Solution code:
s

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(w+):
  print('#', end='')
print('#')
for i in range(h):
  print('#' + x[i] + '#')

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

#define mod 1000000007

#define rep(i, n) for(int i=0; i<n; ++i)

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
 
int main(void){
	
	int H, W;
	char a[110][110];
	
	cin >> H >> W;
	
	rep(i, H)
		rep(j, W)
			cin >> H[i][j];
	
	rep(i, H+2){
		rep(j, W+2){
			if(j == 0 || j == W+1 || i == 0 || i == H+1)
				cout << '#';
			else
				cout << a[i-1][j-1];
		}
		cout << endl;
	}
	
	return 0;
}

Submission status: Runtime Error

Solution code:
import numpy as np

def test():
    h,w = map(int,input().split())
    arr = np.full((h+2,w+2),"#")
    for i in range(1,h+1):
        a = list(input())
        for j in range(1,w+1):
            arr[i][j] = a[j-1]
    for i in range(h+2):
        print("".join(arr[i]))


if __name__ == "__main__":
    test()

Submission status: Runtime Error

Solution code:
import numpy as np

def test():
    h,w = map(int,input().split())
    arr = np.full((h+2,w+2),"#")
    for i in range(1,h+1):
        a = list(input())
        for j in range(1,w+1):
            arr[i][j] = a[j-1]
    print(arr)


if __name__ == "__main__":
    test()

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    int h,w;
    cin >> h >> w;
    char c[h+2][w+2];
    rep(i,h){
        rep(j,w){
            cin >> c[i+1][j+1];
        }
    }
    rep(i,h+2){
        rep(j,w+2){
            if(i==0 || i==h+1 || j==0 || j==w+1) c[i][j]='#';
        }
    }
    rep(i,h+2){
        rep(j,w+2){
            cout << c[i][j];
        }
        cout << endl;
    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())

temp=["#" for _ in b+2]
mass = []
mass.append(temp)
for _ in range(a):
  mass.append(["#"] + list(input()) + ["#"])
mass.append(temp)

for retsu in mass:
  retsu = "".join(retsu)
  print(retsu)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())

temp=["#" for _ in b+2]
mass = []
mass.append(temp)
for _ in range(a):
  mass.append(["#"] + input() + ["#"])
mass.append(temp)

for retsu in mass:
  retsu = "".join(retsu)
  print(retsu)

Submission status: Runtime Error

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

a.insert(0,b)
a.append(b)
  
for i in a:
  print("".join(str(a[i])))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a = {}
b = []

for i in h+2:
  b.append('#')

a.insert(0,b)
a.insert(h+2,b)

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

print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = ["#"*(W+2)]
for _ in range(H):
    data.append("#" + input() + "#")
deta.append("#"*(W+2))
for j in data:
    print(j)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w = map(int,input().split())
for i in range(h+2):
  if i ==0 or i == h+1:
    for d in range(w+2):
      print("#",end="")
      continue
  print("#"+input()+"#")

Submission status: Runtime Error

Solution code:
h,w = map(int,input().split())
for i in range(h+2):
  if i ==0 or i == h+1:
    for d in range(w+2):
      print("#",end="")
  print("#"+input()+"#")

Submission status: Runtime Error

Solution code:
a,b = map(int,input()split())
print('#'*(b+2))
for _ in range(a):
  c = input()
  print('#{}#'.format(c))
print('#'*(b+2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H, W = map(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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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):
    l = list(input().split())
    for j in range(1, W+1):
        grid[i][j] = l[j-1]

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

Submission status: Runtime Error

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 a:
    i = '#'+ i +'#'
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
1 1
z

Submission status: Runtime Error

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