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):
while True:
    H,W=map(int,input().split())
    if H==0 and W==0:
        break
    else:
        print('
        for i in range(1,H-1):
            print('
        print('
        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) :
        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 j==0 or i==H-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
    print('
    for a 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):
        if i == 0 or i == a-1:
            print("
        else:
            for j in range(b):
                if j == 0 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 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:
    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:
        a=list(map(int,input().split()))
        if a[0]==0:
            pass
        else:
            
            for i in range(a[1]):
                print('
            print()
            for j in range(a[0]-2):
                print('
                for w in range(a[1]-2):
                    print('.',end='')
                print('
            for k in range(a[1]):
                print('
            print()
            print()
        
    except:
        break;

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

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

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

Solution (Python):
while True:
    W, H = map(int, input().split())
    if W == 0 and H == 0:
        break
    else:
        for j in range(W):
            if j == 0 or j == W-1:
                for i in range(H):
                    print('
                print()
            else:
                for i in range(H):
                    if i == 0 or i == 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
    else:
        for i in range(a):
            if i == 0 or i == a-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("
            for j in range(2,w):
                print(".",end="")
            print("
            print()
            
    print()

Solution (Python):
while True :
    x,y=input().split()
    if int(x)==0 and int(y)==0 : break
    i=1
    while i<=int(x) :
        k=1
        while k<=int(y) : 
            if i==1 or i==int(x) or k==1 or k==int(y) : print("
            else : print(".",end="")
            k=k+1
        print("")
        i=i+1
    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:
                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
    else:
        print('
        for hline in range(h-2):
            print('
        print('
        print('')

Solution (Python):
j = 0
while j < 10**10:
    h, w = map(int, input().split()) 
    if h == 0 and w == 0:
        break
    j = j + 1
    
    i = 0
    while i < h:
        i = i + 1
        if i == 1 or i == h:
            print('
        else:
            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:
    
    h,w = map(int, input().split())
    if h==0 and w==0:
        break
    a=h
    while h>0:
        
        if h==a or h==1:
            print("
        else:
            print("
        h-=1
    
    print("")

Solution (Python):
while True:
    h, w = [int(arg) for arg in input().split()]
    if h == 0 and 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
    
    print("
    
    for _ in range(H - 2):
        print("
    
    print("
    print()

Solution (Python):
list = []
while True:
    a = [int(i) for i in input().split()]
    if a[0] == 0 and a[1] == 0:
        break
    else:
        list.append(a)

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

Solution (Python):



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

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

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
    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):
        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
    
    print("
    i=1
    while i<=H-2:
        
        print("
        i+=1
    print("
    print("")

Solution (Python):
for e in list(open(0))[:-1]:h,w=map(int,e.split());print('

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

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

Solution (Python):
def test_case():
    while True:
        a, b = map(int, input().split())
        if a == 0 and b == 0:
            break
        t_b = ''.join(['
        inner = '
        for idx, _ in enumerate(range(a)):
            if idx == 0 or idx == (a - 1):
                print(t_b)
            else:
                print(inner)
        print('')


if __name__ == "__main__":
    test_case()

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):
        if i == 0 or i == H-1:
            for j in range(W):
                print('
            print()
            
        else:
            for j in range(W):
                if 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:
        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:
            d = '.' * (w-2)
            print('
    print("")

Solution (Python):
while True:
    H, W =map(int,input().split())
    
    if(H == 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
    print('
    for i in range(H-2):
        print('
        
    print('
    print()

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

Solution (Python):
while True:
    h, w = map(int,input().split())
    if h == w == 0:
        break
    for i in range(h):
        for j in range(w):
            if i == 0 or i == (h-1):
                print("
            else:
                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):
while True:
    H, W = input().split()
    H = int(H)
    W = int(W)

    if H == 0 and W == 0:
        break
    for a in range(H):
        for b in range(W):
            if a == 0 or a == len(range(H)) - 1:
                print('
            else:
                if b == 0 or b == len(range(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 k == 0 or k == w-1 or i == 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):
        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:
        print("
        for i in range(1,H-1):
            print("
            print("."*(W-2),end="")
            print("
        print("
        print()

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

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

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

    if H != 0 and W != 0:
        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("")
    else:
        break

Solution (Python):
from sys import stdin

while True:
    H,W = map(int, stdin.readline().split())
    str = ''
    
    if W == 0 and H == 0:
        break
    
    for i in range(H):
        if i == 0 or i == H-1:
            str += '
        else:
            str += '
    print(str)

Solution (Python):
while True:
  H,W = map(int,input().split())
  if H == 0 and W == 0: break
  
  for x in range(H):
    for y in range(W):
      if x == 0 or y == 0 or y == W-1 or x == H-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
        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()
    return 0


if __name__ == "__main__":
    main()

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):
H = []
W = []
while True:
    input_item = list(map(int, input().split()))
    if input_item == [0, 0]:
        break
    H.append(input_item[0])
    W.append(input_item[1])

for i in range(len(H)):
    h = H[i]
    w = W[i]
    print("
    for _ in range(h-2):
        print("
    print("
    print()

Solution (Python):
while True:
    h, w = map(int, input().split())
    if w == 0 and h == 0:
        break
    for i in range(1, h+1):
        if i == 1 or i == h:
            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 (0, h):
        if i==0 or i==h-1:
            print('
        else:
            putstr = '.'*(w-2)
            print(f'

    print()

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

Solution (Python):
def p_s(H, W):
    for i in range(H):
        str = ''
        for j in range(W):
            if j == 0:
                str += "
            elif j == (W - 1):
                str += "
            elif i == 0:
                str += "
            elif i == (H - 1):
                str += "
            else:
                str += "."
        print(str)
    print()


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

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
  print("
  for i in range(H - 2):
    print("
    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):
Inlist = []

while True:
    val = list(map(int, input().split()))
    H, W = val[0], val[1]
    if H == 0 and W == 0:
        break
    else:
        Inlist.append(val)
    
for HW in Inlist:
    H, W = HW[0], HW[1]
    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==0 and W==0:
        quit()
    

    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('
        
        if i == H-1:
            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("."*(W-2),end="")
        print("
    print("
    print()

Solution (Python):
while True:
  H, W = map(int, input().split())
  if W == 0 and H == 0:
    break
  
  for i in range(W):
    print("
  print() 
  
  for j in range(H - 2):
    for i in range(W):
      if i == 0 or i == W -1:
        print("
      else:
        print(".", end="")
    print()
  
  for i in range(W):
    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 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
    print("
    for i in range(h-2):
        print("
    print("
    print("")

Solution (Python):
BIG_NUM = 2000000000

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):
H = []
W = []
while True:
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    else:
        H.append(h)
        W.append(w)
for i in range(len(H)):
    for j in range(H[i]):
        for k in range(W[i]):
            if j == 0 or j == H[i]-1 or k == 0 or k == W[i]-1:
                print('
            else:    
                print('.',end="")
        print("")
    print("",end="\n")

Solution (Python):
while True:
    H, W = map(int, input().split())
    if H != 0:
        for i in range(H):
            if i==0 or i==H-1:
                print("
            else:
                print("
        print("")
    else:
        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 == w == 0:
        break
    else:
        print("
        for i in range(0, h - 2):
            print("
        print("
    print()

Solution (Python):
while True:
    h, w = map(int, input().split())

    if h==0 and w ==0:
        break
    
    else:
        count=1
        for i in range(0, h):
            if count==1:
                print('
            elif count==h:
                print('
            else:
                print('
            count+=1
    print()

Solution (Python):
while True:
    H, W = list(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:
                print('
            elif 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:
		exit(0)
	for i in range(0, h):
		for j in range(0, 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|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 = list(map(int,input().split()))
    if H*H + W*W == 0:
        break
    for i in range(H):
        if i*(H-i-1)==0:
            for j in range(W):
                print("
            print("")
        else:
            print("
            for j in range(W-2):
                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 or i == H-1:
                print('
            else:
                print('
    print()

Solution (Python):
while True :
    H, W = map(int, input().split())
    if H == 0 :
        break
    else :
        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(".", sep = "", end = "")
            print()
        print()

Solution (Python):
while True:
    h,w  = map(int, input().split())
    
    if w == 0 and h == 0:
        break
    for x in range(h):
        for y in range(w):
            if x == 0 or x == (h-1) or y == 0 or y == (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(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 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:
    H,W = map(int,input().split())
    if H == 0 and W == 0:
        break
    else:
        for i in range(0,H):
            if i == 0 or i == H-1:
                print("
            else:
                for j in range(0,W):
                    print ("
                print()
        print()

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

Solution (Python):
while True:
  H, W = list(map(int, input().split()))
  if H == 0 and W == 0:
    break
  else:
    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
    else:
        print("
        for i in range(1, H - 1):
            print("
        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):
            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 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(not H and not W):
        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
    else:
        for i in range(H):
            if i==0 or i==H-1: 
                print(W*"
            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):
while True:
    a,b = input().split(" ")
    bn = int(b) - 2
    an = int(a) - 2
    i = int(a) + int(b)
    if i == 0:
        break
    for n in range(int(b)):
        print("
    print('\r')
    for a in range(an):
        print("
        for m in range(bn):
            print(".",end="")
        print("
    for n in range(int(b)):
        print("
    print('\r')
    print('\r')

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(H- 2):
        print("
    print('

    print()

Solution (Python):
while True:
    h,w = [int(x) for x in input().split()]
    width = []

    if h == 0 and w == 0:
       break
    else:
        for i in range(w):
            if i == 0 or i==w-1:
                width.append("
            else:
                width.append(".")
        print("".join(["
        for j in range(h-2):
            print("".join(width))
        print("".join(["
        print()

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

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

while H != 0 and 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(i) for i in input().split()]

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

    else:
        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 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):
        if i == 0 or i == h - 1:
            print("
        else:
            print("
    print("")

Solution (Python):
list_HW = list()
while True:
    base = input("")
    term = base.split(' ')
    if(int(term[0]) == 0 and int(term[0]) == 0):
        break
    else:
        map_HW = {'H': int(term[0]), 'W': int(term[1])}
        list_HW.append(map_HW)

for HW in list_HW:
    h = HW['H']
    w = HW['W']

    for r in range(h):
        if r == 0 or r == (h-1):
            for s in range(w):
                print('
        else:
            for s in range(w):
                if s == 0 or s == (w-1):
                    print('
                else:
                    print('.',end='')
        print('',end='\n')

    print('',end='\n')

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

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

Solution (Python):
while (1):
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        exit()
    else:
        tile = str()
        for i in range(w):
            tile += '
        tile += '\n'

        for i in range(h-2):
            tile += '
            for ii in range(w-2):
                tile += '.'
            tile += '

        for i in range(w):
            tile += '
        tile += '\n'
        print(tile)

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()