Problem:
Print a Frame Draw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm. ##########
#........#
#........#
#........#
#........#
########## Input The input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space. The input ends with two 0 (when both H and W are zero). Output For each dataset, print the frame made of '#' and '.'. Print a blank line after each dataset. Constraints  3 ≤ H ≤ 300  3 ≤ W ≤ 300  Sample Input 3 4
5 6
3 3
0 0 Sample Output ####
#..#
####

######
#....#
#....#
#....#
######

###
#.#
###

Solution (Python):
lines = []
colums = []
 
while True:
  H,W = map(int,input().split())
  if H == 0 and W == 0:
    break
  lines.append(H)
  colums.append(W)
 
for H,W in zip(lines,colums):
  for i in range(H):
    if i == 0 or i == H-1:
      for j in range(W):
        print("
    else:
      for j in range(W):
        if 0 < j and j < W-1:
          print(".",end="")
        else:
          print("
    print("\n",end="")
  print("\n",end="")

Solution (Python):
while True:
 
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for j in range(W):
            if i == 0 or i == H-1 or j == 0 or j == W-1:
                print("
            else:
                print(".",end = "")
        print()
 
    print()

Solution (Python):
while True:

    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for k in range(W):
            if i == 0 or i == H-1 or k == 0 or k == W-1:
                print("
            else:
                print(".",end = "")
        print()

    print()

Solution (Python):
def main():

    while True:

        num = [int(x) for x in input().split(' ')]

        if num[0] == 0 and num[1] == 0:
            break

        
        for i in range(num[1]):
            print('
        print('')

        
        for i in range(num[0]-2):
            print('
            for j in range(num[1]-2):
                print('.', end='')
            print('

        
        for i in range(num[1]):
            print('
        print('')

        print('')


if __name__ == "__main__":
    main()

Solution (Python):
while True:
  H,W = map(int, input().split())
  if W==0 and H==0:
   break
  for i in range(H):
    for j in range(W):
      if i==0 or i==H-1 or j==0 or j==W-1:
        print('
      else:
        print('.',end="")
    print()
  print()

Solution (Python):
while True:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    else:
        for i in range(H):
            if i == 0:
                print("
                continue
            elif i == H-1:
                print("
                continue
            else:
                for j in range(W):
                    if j == 0 or j == W-1:
                        print("
                    else:
                        print(".", end="")
                else:
                    print()
        else:
            print()

Solution (Python):
while True:
    a = input()
    b = a.split()
    x = int(b[0])
    y = int(b[1])
    if x == 0 and y == 0 :
        break
    else:
        for i in range(x):
            if i == 0 or i == x-1:
                print("
            else:
                print("
                
    print()

Solution (Python):
H,W=map(int,input().split())
t = 0
while not ( H == 0 and W == 0 ):
	borderline = "".join(["
	line = "

	for h in range(H):
		if h == 0 or h == H-1:
			print(borderline)
		else:
			print(line)

	print("")
	t+=1
	H,W=map(int,input().split())

Solution (Python):
while True:
  H,W=map(int,input().split())
  if H==0 and W==0:
    break
  for h in range(H):
    for w in range(W):
      if w==0 or w==W-1 or h==0 or h==H-1:
        print("
      else:
        print(".",end="")
    print()
  print()

Solution (Python):
while True:
  h, w = map(int, input().split())
  if h == 0 and w == 0:
    break
  for i in range(h):
    if i == 0 or i == h-1:
      print("
    else:
      print("
      print("."*(w-2), end = "")
      print("
  print()

Solution (Python):
square = []
while True:
    data = [int(e) for e in input().split()]
    if data[0]==0 and data[1]==0:
        break
    square.append(data)
    
for i in range(len(square)):
    for j in range(square[i][0]):
        for k in range(square[i][1]):
            if k==0 or k==square[i][1]-1 or j==0 or j==square[i][0]-1:
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
if __name__ == '__main__':
	h,w = map(int, input().split())
	while h+w!=0:
		for i in range(h):
			if i == 0 or i == h-1:
				print("
			else:
				print("
		print()
		h,w = map(int, input().split())

Solution (Python):
while True:
    H,W = [int(x) for x in input().split()]
    if(H,W) == (0,0):break
    
    for i in range(H):
        for j in range(W):
            if i == 0 or i == H-1 or j == 0 or j ==W-1: 
                print('
            else:
                print('.', end='')
        print('')
        
    print('')

Solution (Python):





class math:
    
    pi = 3.14159265358979323846264338

    
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

math = math()












while True:
    i = input()
    X, Y = [int(x) for x in i.split()]
    if X == 0:
        break
    for n in range(X):
        for m in range(Y):
            if n == 0 or n == X-1 or m == 0 or m == Y-1:
                print("
            else:    
                print(".", end="")
        print("")
    print("")

Solution (Python):
while True:
	y,x = map(int,input().split())
	if y == 0 and x == 0:
		break
	
	print("
	for j in range(y-2):
		print("
	print("
	print()

Solution (Python):
while True:
    H, W = map(int, input().split())
    
    if H == 0 and W ==0:
        break
    
    for i in range(H):
        if i == 0 or i == (H-1):
            print('
        else:
            print('
    
    print('\r')

Solution (Python):
HL=list()
WL=list()
while True:
    H,W=map(int,input().split())
    HL.append(H)
    WL.append(W)
    if H==0 and W==0:
        break
for i in range(len(HL)):
    for j in range(HL[i]):
        if j==0 or j==HL[i]-1:
            for k in range(WL[i]):
                print("
            print("")
        else:
            print("
            for l in range(WL[i]-2):
                print(".",end="")
            print("
        if j==HL[i]-1:
            print("")

Solution (Python):
line = []
while True:
    b = list(map(int, input().split()))
    if b[0] == 0 and b[1] == 0:
        break
    else:
        line.append(b)
for i in line:
    for j in range(i[0]):
        for k in range(i[1]):
            if j % (i[0]-1) == 0 or k % (i[1]-1) == 0:
                print("
            else:
                print(".", end = "")
        print()
    print()

Solution (Python):
while True:
	l=list(map(int,input().split()))
	if l[0]==0 and l[1]==0:
		break
	else:
		print('
		for i in range(l[0]-2):
			print('
		print('
		print('')

Solution (Python):
H , W = map(int,input().split())
while H != 0 and W != 0:
  for i in range (W-1):
    print('
  print('
  for j in range (H-2):
    print('
    for k in range (W-2):
      print('.',end='')
    print('
  for i in range (W):
    print('
  print()
  print()
  H , W = map(int,input().split())

Solution (Python):
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    for i in range(H):
        for j in range(W):
            if i==0 or i==H-1 or j==0 or j==W-1:
                print("
            else:
                print(".",end="")
        print()
    print()

Solution (Python):
while True:
    d = [int(i) for i in input().split()]
    if d[0] == 0:
        break
    w = ["
    print("".join(w))
    m = "
    for i in range(d[0]-2):
        print(m)
    print("".join(w))
    print("")

Solution (Python):
while True:
    h, w = map(int, input().split())
    if h == w == 0: break
    print('
    for _ in range(h - 2):
        print('
    print('
    print()

Solution (Python):
while True:
    h,w=map(int,input().split())
    if h==0 and w==0:
        break
    for i in range(h):
        for k in range(w):
            if i == 0 or i == h - 1 or k == 0 or k == w - 1:
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
while True:
    x = input()
    list = x.split()
    list_i = [int(s) for s in list]
    [H, W] = list_i

    
    if H == 0 and W == 0:
        break

    
    for a in range(W - 1):
        print("
    print("

    
    for b in range(H - 2):
        print("
        for y in range(W - 2):
            print(".", end="")
        print("
    
    
    for a in range(W - 1):
        print("
    print("
    
    print()

Solution (Python):
a = []
while True:
    x = list(map(int, input().split()))
    a.append(x)
    if x[0] == 0 and x[1] == 0:
        break

isize = len(a)-1
for i in range(isize):
    jsize = a[i][0]
    for j in range(jsize):
        ksize = a[i][1]
        for k in range(ksize):
            if j == 0 or j == (jsize-1):
                print('
            else:
                if(k == 0 or k == (ksize-1)):
                    print('
                else:
                    print('.', end='')
        print(end='\n')
    print(end='\n')

Solution (Python):
sides = list(map(int, input().split()))
while sides != [0, 0]:
    line0 = '
    lines = '
    lines *= sides[0]-2
    print(line0)
    print(lines, end = '')
    print(line0 + '\n')
    sides = list(map(int, input().split()))

Solution (Python):
while True:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for k in range(W):
            if i == 0 or i == H-1 or k == 0 or k == W-1:
                print("
            else:
                print(".",end = "")
        print()
 
    print()

Solution (Python):
while True:
  H, W = map(int, input().split())
  if H == 0 and W == 0:break
  print('
  for i in range(1,H-1):
    print('
  print('
  print()

Solution (Python):



flag = True
rectangles = []
while flag:
    size = [int(i) for i in input().split()]
    H = size[0]
    W = size[1]
    if H == 0:
        flag = False
        break

    rectangle = []
    for h in range(H):
        row = []
        if h == 0 or h == H-1:
          for w in range(W):
              row.append('
        else :
          for w in range(W):
              if w == 0 or w == W-1:
                row.append('
              else :
                row.append('.')
        rectangle.append(row)
    rectangles.append(rectangle)

for rectangle in rectangles:
    for row in rectangle:
        print(''.join(row))
    print('')

Solution (Python):
while 1:
    h, w = map(int, input().split())
    if h==0:
        break
    else:
        print('
        for _ in range(h-2):
            print('
        print('
    print()

Solution (Python):
while True:
    H, W = map(int,input().split())
    if H == 0 and W == 0:
        break
    print("
    for i in range(H - 2):
        print("
    print("
    print("\n",end="")

Solution (Python):
while True:
    H,W=map(int,input().split())
    if H==0 and W==0 :
        break
    print("
    for i in range(H-2):
        print("
    print("
    
    print()

Solution (Python):
while True:
    h,w = map(int,input().split())
    if h==w==0:
        break
    print("
    for _ in range(h-2):
        print("
    print("
    print()

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

while H != 0 or W != 0:
    print("
    for i in range(1, H - 1):
        print("
    print("
    print("")
    H, W = map(int, input().split())

Solution (Python):
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):    
        for j in range(w):
            if i == 0 or i ==  h - 1 or j == 0 or j == w - 1:   
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
while True:
    i = input()
    H, W = map(int,i.split())
    
    if H == 0 and W == 0:
        break
    
    for h in range(H):
        for w in range(W):
            if h == 0 or h == H-1 or w == 0 or w == W-1:
                print("
            else:
                print(".",end="")
        print()
    print()

Solution (Python):
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    else:
        for j in range(h):
            if j == 0 or j == int(h)-1:
                print("
            else:
                print("
                print("." * (w-2), end ="")
                print("
        print()

Solution (Python):
while 1:
    data=list(map(int,input().split()))
    
    if data[0]==0:break
    
    for i in range(data[0]):
        for j in range(data[1]):
            if i==0 or i==data[0]-1 or j==0 or j==data[1]-1:
                print('
            else:
                print('.',end='')
        print()
    print()

Solution (Python):




























while True:
    H, W = map(int, input().split())

    if H == 0 and W == 0:
        break
    else:
        for h in range(H):
            for w in range(W):
                if h == 0 or h == H - 1:
                    print("
                elif w == 0 or w == W - 1:
                    print("
                else:
                    print(".", end='')
            print()
        print()

Solution (Python):



while  1:
	H, W = map(int, input().split())
	if H == W == 0:
		break
	for i in range(H):
		if i == 0 or i == H - 1:
			print("
		else:
			for j in range(W):
				if j == 0 or j == W - 1:
					print("
				else:
					print(".", end="")
			print()
	print()

Solution (Python):
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:
        break
    print('
    for i in range(a-2):
        print('
    print('
    print()

Solution (Python):
h = []
w = []
while True:
    h1,w1 = map(int,input().split())
    if (h1 == 0)*(w1 == 0) :
        break
    h.append(int(h1))
    w.append(int(w1))
    

for i in range(len(h)):
    for j in range(h[i]):
        if (j == 0) or (j==h[i]-1):
            print("
        else:
            print("
    print()

Solution (Python):
while True:
    (x,y)=[int(i) for i in input().split()]
    if x==y==0:break
    print("
    for i in range(1,x-1):
        print("
    print("
    print()

Solution (Python):
while True:
  a,b = map(int,input().split())

  if a == 0 & b == 0:
    break

  for i in range(a):
    if i == 0:
      print("
    elif i == a-1:
      print("
      print()
    else:
      print("

Solution (Python):
while True:
    i = input()
    H,W  = map(int, i.split())

    if H == 0 and W == 0:
        break
    
    for i in range(H):
        if i == 0 or i == H-1:
            for i in range(W):
                print('
            print()
        else:
            for i in range(W):
                if i == 0 or i == W-1:
                    print('
                else:
                    print('.', end = '')
            print()
    print()

Solution (Python):


import sys

hw = []
h,w = map(int, input().split())
while h+w > 0:
  hw.append([h,w])
  h,w = map(int, input().split())

for i in range(len(hw)):
  for h in range(hw[i][0]):
    if h in [0, hw[i][0]-1]:
      s = "
    else:
      s = "
    print(s)
  print()

Solution (Python):
while(True):
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    for i in range(H):
        if i==0 or i==H-1:
            print('
        else:
            print('
    print()

Solution (Python):
while True:
	h, w = map(int, input().split())
	if h == 0 and w == 0:
		break
	for i in range(h):
		for j in range(w):
			if i == 0 or i == h - 1 or j == 0 or j == w - 1:
				print('
			else:
				print('.', end = '')
		print()
	print()

Solution (Python):
while True:
    H, W = map(int, input().split(' '))
    if H == 0 and W == 0:
        break
    
    for i in range(H):
        for j in range(W):
            
            if  i == 0 or j == 0 or i == H - 1 or j == W - 1:
                print('
            else:
                print('.', end = '')
        print()
    print()

Solution (Python):
while True:
    try:
        H, W = map(int, input().split())
        
        if H == 0 and W == 0:
            break;
        for i in range(H):
            if i == 0 or i == H-1:
                print('
            else:
                print('
        print()
        
    except:
        break;

Solution (Python):
while True:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    print("
    for i in range(H-2):
        print("
    print("
    print()

Solution (Python):
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        if i == 0 or i == h - 1:
            print('
        else:
            print('
    print()

Solution (Python):
while True:
    string = input()
    numbers = list(map(int, string.split(' ')))
    if numbers[0] == 0 and numbers[1] == 0:
        break
    for i in range(numbers[0]):
        if i == 0 or i == numbers[0] - 1:
            for j in range(numbers[1]):
                print('
        else:
            print('
            for j in range(numbers[1] - 2):
                print('.', sep='', end='')
            print('
        print()
    print()

Solution (Python):
while True:
    H,W = map(int,input().split())
    if H==0 and W==0:break
    print("
    for i in range(H-2):
        print("
    print("
    print()

Solution (Python):
while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break

    for i in range(x):
        for j in range(y):
            if i == 0 or i == x-1 or j == 0 or j == y-1:
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
while True:
    H,W = map(int,input().split())
    if H==0 and W==0:
        break
    print('
    for i in range(H-2):
        w = W-2
        s = '.'*w
        print('
    print('
    print()

Solution (Python):
while True:
    h,w = map(int,input().split())
    if int(h) == 0 and int(w) == 0:break
    for i in range(h):
        for j in range(w):
            if i==0 or i==h-1 or j==0 or j==w-1:
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
while 1:
        H,W = map(int ,input().split())
        if W == H == 0: break
        for i in range(H):
                for j in range(W):
                        if i <1 or i>=H -1  or j < 1 or j >= W - 1:
                                print('
                        else:
                                print('.',end ="")
                print('')
        print('')

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    for i in range(H):
        for k in range(W):
            if i == 0 or i == H-1 or k == 0 or k == W-1:
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
while True:
    a, b = map(int, input().split())
    if (a == 0 and b == 0):
        break
    print('\n'.join(['

Solution (Python):
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:break
    for j in range(H):
        for i in range(W):
            if i==0 or i==W-1 or j==0 or j==H-1:
                print("
            else:
                print(".",end="")
        print()
    print()

Solution (Python):
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    print(b*"
    for i in range(a-2):
        print("
    print(b*"
    print()

Solution (Python):
while True:
    height, width = map(int, input().split())
    if height == 0 and width == 0:
        break
    for i in range(height):
        if i == 0 or i == height -1:
            print("
        else:
            print("
    print()

Solution (Python):

i = False
while True:
    line = input().rstrip().split()
    H = int(line[0])
    W = int(line[1])
    if H == 0 and W == 0:
        print("\n",end="")
        break
    if i:
        print("\n",end="")
    for i in range(H):
        for j in range(W):
            if i == 0 or j == 0 or i == H-1 or j == W-1:
                print("
            else:
                print(".",end="")
        print("\n",end="")
    i =True

Solution (Python):
while True:
    h, w = map(int, input().split())
    if w+h:
        for r in range(h):
            print('
        print()
    else:
        break

Solution (Python):


while True:
    H, W = map(int, input().split())
    if (H, W) == (0, 0):
        break
    print('
    for i in range(H - 2):
        print('
    print('
    print('')

Solution (Python):
while True:
    a,b = map(int,input().split())
    if a == 0 and b == 0:
        break
    for i in range(a):
        for j in range(b):
            if i == 0 or j == 0 or i == a-1 or j == b-1:
                print("
            else:
                print(".", end = "")
        print()
    print()

Solution (Python):
while True:
    H,W = map(int, input().split())
    if H == W == 0:
        break
    print('
    for i in range(0,H-2):
        print('
    print('
    print()

Solution (Python):
while True:
    list = input().split()
    a = int(list[0])
    b = int(list[1])
    if a == 0 and b == 0:
        break
    for i in range(a):
        for j in range(b):
            if i == 0 or j == 0 or i == a - 1 or j == b - 1:
                print("
            else:
                print(".", end = "")
        print()
    print()

Solution (Python):
while True:
  h, w = map(int, input().split())
  if h == 0 and w == 0:
    break
  
  for x in range(0, h):
    string = ""
    for y in range(0, w):
      if x == 0 or x == h - 1 or y == 0 or y == w - 1:
        string += "
      else:
        string += "."
    print(string)
  
  print()

Solution (Python):
while True:
    h, w = map(int, input().split())
    ans = []
    if h == 0 & w == 0:
        break
    else:
        for i in range(h):
            for j in range(w):
                if i == 0 or j == 0 or i == h - 1 or j == w -1:
                    print("
                else:
                    print(".",end="")
            print("")
        print("")

Solution (Python):
def main():
    while True:
        H, W = map(int, input().split())
        if H == 0 and W == 0:
            break
        print('
        for _ in range(H - 2):
            col = '
            for _ in range(W - 2):
                col += '.'
            col += '
            print(col)
        print('
        print()


main()

Solution (Python):
while True:
    h,w = map(int,input().split())
    if h==0: break
    print(("

Solution (Python):
while True:
        a=input()
        b=a.split()
        c=int(b[0])
        d=int(b[1])
        if c==0 and d==0:
                break
        for j in range(c):
                for k in range(d):
                        if k==0 or k==d-1 or j==0 or j==c-1:
                                print("
                        else:
                                print(".",end="")
                print()
        print()

Solution (Python):
a, b = map(int, input().split())
while a > 0 or b > 0:
	for i in range(a):
		for j in range(b):
			if i > 0 and i < a - 1 and j > 0 and j < b - 1:
				print(".", end="")
			elif j == b - 1:
				print("
			else:
				print("
	print("")
	a, b = map(int, input().split())

Solution (Python):
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        if i ==0 or i == h-1:
            print("
        else:
            print("
    print()

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H == W == 0:
        break
    for h in range(H):
        if h == 0 or h == H-1:
            print("
        else:
            print("
    print()

Solution (Python):
while True:
    h, w = map(int, input().split())
    if h == w == 0:
        break
    for i in range(h):
        print('
    print()

Solution (Python):
w, h = [eval(x) for x in input().split()]
while w != 0 and h != 0:
    for i in range(w):
        if i == 0 or i == w - 1:
            print('
        else:
            print('
        
    print()
    w, h = [int(x) for x in input().split()]

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    else:
        print("
        for h in range(H - 2):
            print("
        print("
        print ()

Solution (Python):
for j in range(1000):
    
    a, b = map(int, input().split())
    
    if a == 0 and b == 0:
        break
    
    for i in range(a):
        if i == 0 or i == (a-1):
            print('
        else:
            print('
        
    print('')

Solution (Python):
import sys
i = 0
H = []
W = []
while(1):
    tmp = [int(x) for x in input().split()]
    H.append(tmp[0])
    W.append(tmp[1])
    if(H[i]==0 and W[i]==0):
        break
    i+=1
for u in range(i):
        for s in range(H[u]):
            if(s==0 or s==H[u]-1):
                for t in range(W[u]):
                    sys.stdout.write('
                print("")
            else:
                for t in range(W[u]):
                    if(t==0 or t==W[u]-1):
                        sys.stdout.write("
                    else:
                        sys.stdout.write(".")
                print("")
        print("")

Solution (Python):
while 1:
    a,b=map(int, input().split())
    if not a+b:break
    print('
    for i in range(a-2):
        print('
    print('
    print()

Solution (Python):
while True:
    h,w = map(int, input().split())
    if h == 0 and w == 0: break
    for j in range(h):
        for i in range(w):
            if i == 0 or j == 0 or i == w-1 or j == h-1:
                print("
            else:
                print(".", end="")
        print()
    print()

Solution (Python):
def print_rec(H, W):
    print('
    for _ in range(H-2):
        print('
    print('

if __name__ == '__main__':
    input_buf = []
    while True:
        H, W = map(int, input().split())
        if (H, W) == (0, 0):
            break
        input_buf.append((H, W))
    for H, W in input_buf:
        print_rec(H, W)
        print()

Solution (Python):
while True :
    H, W = map(int, input().split())
    if H == 0 and W == 0 :
        break
    else :
        for i in range(H):
            if i == 0 or i == H - 1 :
                if i == 0 :
                    print("
                else :
                    print("
            else :
                print("

Solution (Python):
while True :
    H,W = map(int,input().split())
    if H == W == 0 : break
    setA = "
    setB = "
    for i in range(H) :
        if i == 0 or i == H-1 : print(setA)
        else : print(setB)
    print()

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break
    print('
    for i in range(H - 2):
        print('
    print('
    print()

Solution (Python):
while True:
    a, b = map(int, input().split())
    if a == b and a == 0:
        break

    for i in range(a):
        for j in range(b):
            if i == 0 or i == a - 1 or j == 0 or j == b - 1:
                print("
            else:
                print(".", end = "")
        print()
    print()

Solution (Python):
def main():
    while True:
        x, y = map(lambda n: int(n), input().split(' '))
        if x == 0 and y == 0:
            break

        print("
        for i in range(x-2):
            print("
        print("
        print("")


def get_input():
    while True:
        try:
            line = input()
            if line == '':
                break
            else: 
                yield line
        except EOFError:
            break


if __name__ == "__main__":
    main()

Solution (Python):
while True:
    H,W = [int(i) for i in input().split()]
    if H == 0 and W == 0:
        break
    print("
    for i in range(H-2):
        print("
    print("
    print()

Solution (Python):
import sys

for line in sys.stdin:
    h, w = map(int, line.strip().split())
    if h == 0 and w == 0:
        break

    print('
    for _ in range(1, h - 1):
        print('
    print('

    print()

Solution (Python):
while True:
    h, w = [int(i) for i in input().split(' ')]
    if h == 0 and w == 0:
        exit()
    print('
    for j in range(h-2):
        print('
    print('
    print()

Solution (Python):
while True:
    HW = input()
    HW_list = HW.split(" ")
    H = int(HW_list[0])
    W = int(HW_list[1])
    if H == 0 and W == 0:
        break
    print("
    for _ in range(H - 2):
        print("
    print("
    print()

Solution (Python):
while True:
    line = input().rstrip()
    if line == "0 0":
        break
    lst = list(map(int, line.split()))
    h = lst[0]
    w = lst[1]
    print("
    for i in range(h-2):
        print("
    print("
    print()

Solution (Python):
while True:
    h, w = list(map(int, input().split()))
    if h==0 and w==0:
        break
    s0 = '
    print(s0)
    for i in range(1,h-1):
        s = '
        print(s)
    print(s0)
    print()

Solution (Python):
while True:
  h, w = [int(x) for x in input().split()]
  if h == 0 and w == 0:
    break
  for i in range(h):
    for j in range(w):
      if i == 0 or i == h-1 or j == 0 or j == w-1:
        print("
      else:
        print(".", end= "")
    print()
  print()

Solution (Python):
while 1:
    H,W=map(int,input().split())
    if H==W==0:break

    for i in range(H):
        if i==0 or i==H-1:
            print('
        else:
            print('
    print()

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H == W == 0:
        break
    frame = [['
    print('\n'.join([''.join(frame[j]) for j in range(H)]))
    print()

Solution (Python):
while True:
    H,W = map(int,input().split())
    if W == 0 and H == 0:
        break
    for i in range(H):
        if i == 0 or i == H-1:
            print("
        else:
            print("

    print()

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H == 0 and W == 0:
        break

    for i in range(H):
        if i == 0 or i == H - 1:
            print('
        else:
            print('
    print()

Solution (Python):
num_input=list(map(int,input().split()))

h=num_input[0]
w=num_input[1]

while h!=0 or w!=0:
    for i in range(h):
        for j in range(w-1):
            if i==0 or i==h-1 or j==0:
                print("
            else:
                print(".",end="")
        print("

    print()
    num_input=list(map(int,input().split()))

    h=num_input[0]
    w=num_input[1]

Solution (Python):
while True:
	H, W = map(int, input().split())
	if H == 0 and W == 0:  
		break
	for h in range(H):
		str = ''
		for w in range(W):
			if h != 0 and h != (H - 1) and w != 0 and w != (W - 1):
				str += '.'
			else:
				str += '
		print(str)
	print()

Solution (Python):
import sys
for i in range(sys.maxsize):
    h,w=map(int,input().split())
    if h==0 and w==0:
        break
    else:
        for j in range(h):
            if j == 0 or j == h-1:
                print("
            else:
                print("
    print("")

Solution (Python):
h = 1
w = 1
while not(h == 0 and w == 0):
    z = input()
    h,w = [ int(a) for a in z.split()]
    pre = h
    while pre > 0:
        if pre == h or pre == 1:
            print ("
            pre = pre - 1
        else:
            print ("
            pre = pre - 1
    if not(h == 0 and w == 0):
        print ()