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
    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==W==0:
        break;
    print("
    for i in range(0,H-2):
        print("
    print("
    print()

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

Solution (Python):
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


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


def LS(): return list(sys.stdin.readline().rstrip().split())


while 1:
    h, w = LI()
    if w == h == 0:
        break
    for i in range(h):
        for q in range(w):
            if (1 <= i <= h-2) and (1 <= q <= w-2):
                print('.', end='')
            else:
                print('
        print('', end='\n')
    print('', end='\n')

Solution (Python):
for e in iter(input, "0 0"):
    H, W = [int(x) for x in e.split()]
    [print("
    print()

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

    [print("
    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):
      for k in range(w):
        if j==0 or j==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
    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 = list(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 h in range(H):
        for w in range(W):
            if h == 0 or w == 0 or h == H-1 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:
        print('
        for i in range(2,h):
            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):

for x in range(300):
    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 = 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
    
    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=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:                 
                print("
            elif  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 + 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:
    for r in range(H):
      for c in range(W):
        if r == 0 or r == H - 1 or c == 0 or c == W - 1:
          print('
        else:
          print('.', end = '')
      print()
    print()

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

Solution (Python):
array = []
i = 0
while True:
    height, width = map(int, input().split())
    if height == 0 and width == 0:
        break
    array.append(height)
    array.append(width)


def frame(height, width):
    for i in range(height):
        for k in range(width):
            if i == 0 or i == height - 1 or k == 0 or k == width - 1:
                print("
            else:
                print(".", end="")
        print()
    print()


while True:
    frame(array[i], array[i + 1])
    i += 2
    if i == len(array): break

Solution (Python):
import sys
H = []
W = []

for l in sys.stdin:
    Ha, Wa = map(int, l.split())
    if Ha == 0 and Wa == 0:
        break
    H.append(Ha)
    W.append(Wa)

for i, numH in enumerate(H):
    for num in range(numH):
        if (num == 0) or (num == numH - 1):
            print("
        else:
            sharp = "
            dot = "." * (W[i] - 2)
            print("{0}{1}{0}".format(sharp, dot))
    print()

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

Solution (Python):
while True:
    a,b = map(int,input().split())
    if sum([a,b])==0:
        break
    print("
    for _ in range(a-2):
        print("
    print("
    print("")

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

Solution (Python):
EOL = '0 0'
stdin = [line for line in iter(input, EOL)]
lines = (map(int, line.split()) for line in stdin)

for H, W in lines:
    for i in range(H):
        edge = '
        mid_point = '
        if i in [0, H - 1]:
            print(edge)
        else:
            print(mid_point)
    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())
  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()
  if H == 0 and W == 0:
    break

  print()

Solution (Python):
import sys

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

Solution (Python):
hw = []
buff = []

while True:
    buff = list(map(int, input().split()))
    if [0, 0] == buff:
        break
    else:
        hw.append(buff)

for i in hw:
    for j in range(i[0]):
        for k in range(i[1]):
            if j == 0 or j == (i[0] - 1) or k == 0 or k == (i[1] - 1):
                print("
            else:
                print(".", end="")
        print()
    print()

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

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    while True:
        h,w = map(int, input().split())
        
        if h==0 and w ==0:
            sys.exit()
        print("
        for i in range(h-2):
            print("
        print("
        print("")
    
if __name__ == "__main__":
    main()

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

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

Solution (Python):
a,b=map(int,input().split())
i=0
while a>0 or b>0:
    print("
    for i in range(a-2):
        print("
        for j in range(b-2):
            print(".",end='')
        print("
    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
    print("
    for i in range(h-2):
        print("
    print("
    print()

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

Solution (Python):
def draw_rect(H,W):
    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("")


def read_data():
    ls=[]
    while True:
        s,t=tuple(input().split())
        
        H=int(s)
        W=int(t)
        
        if H==0 and W==0:
            break
        
        ls.append((H,W))
        
    return ls


def draw_all_rect(ls):
    for W,H in ls:
        draw_rect(W,H)
        print("")

ls=read_data()
draw_all_rect(ls)

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

    print('
    for i in range(h - 2):
        print('
    print('
    print()

Solution (Python):
for i in range(100):
    h,w=map(int,input().split())
    if h==0 and w==0:
        break
    
    
    
    else:
        for j in range(1,2):
            for k in range(1,w):
                print('
            print('
        for l in range(2,h):
            print('
            for n in range(2,w):
                print('.',end='')
            print('
        for m in range(h,h+1):
            for n in range(1,w):
                print('
            print('
    print('')

Solution (Python):
for i in range(100):
    h,w=map(int,input().split())
    if h==0 and w==0:
        break
    
    
    
    else:
        for j in range(1,2):
            for k in range(1,w):
                print('
            print('
        for l in range(2,h):
            print('
            for n in range(2,w):
                print('.',end='')
            print('
        for m in range(h,h+1):
            for n in range(1,w):
                print('
            print('
    print('')

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

Solution (Python):
for i in range(10**5):
    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):
        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):
lis=[]
while True:
	w,h=[int(x) for x in input().split()]
	if w==0 and h==0:
		break
	else:
		lis.append([w,h])

for x in lis:
	w,h=x[1],x[0]
	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 & w==0 : break
    for i in range(h):
        if (i==0) | (i==h-1):
            print('
        elif w>2:
            print('
        elif w==2:
            print('
        elif w==1:
            print('
    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 or h == H-1 :
            print("
        else :
            print("
            print()
    print()

Solution (Python):
for i in range(1,301):
    h,w=map(int,input().split())
    if h==0 and w==0:
        break
    else:
        a='
        b='.'
        print(f'{a*w}')
        for j in range(2,h):
            print(f'{a}{b*(w-2)}{a}')
        print(f'{a*w}')
    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:
    HW = input()
    H, W = map(int, HW.split())
    if H == 0 and W == 0:
        break
    print(('
    print()

Solution (Python):
while True:
    a,b= map(int,input().split())
    if a==0:
        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
    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
    for i in range(1,w+1):
        print("
    print()
    for j in range(2,h):
        for k in range(1):
            print("
        for k in range(1,w-1):
            print(".",end="")
        for k in range(1):
            print("
    for l in range(1,w+1):    
        print("
    print()
    print()

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

for i in range(len(a)):
    for i2 in range(a[i]):
        if i2==0 or i2 == (a[i]-1):
            print('
        else:
            c = b[i]-2
            print('{}{}{}'.format('
    print('')

Solution (Python):
for e in iter(input, "0 0"):
    H, W = map(int, e.split())

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

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
    else:
        for i in range(1,h+1):
            for j in range(1,w+1):
                if i==1 or i==h or j==1 or j==w:
                    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):
            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:
    a,b=map(int,input().split())
    if a==0 and b==0:
        break
    else:
        for i in range(a):
            for k in range(b):
                if i==0 or i==a-1 or k==0 or k==b-1:
                    print("
                else:
                    print(".",end="")
            print()
        print()

Solution (Python):
while 1:
    a,b=map(int,input().split())
    if a==b==0:break
    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 i==W-1 or j==0 or j==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
    
    s = ""
    for _ in range(w):
        s += "
    
    ss = "
    for _ in range(w - 2):
        ss += "."
    ss += "
    print(s)
    for _ in range(h - 2):
        print(ss)
    print(s + '\n')

Solution (Python):
while 1:
    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
    
    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:
        break
    for y in range(W):
        print('
    print()
        
    for x in range(H-2):
        print('
        for y in range(W-2):
            print('.', end="")
        print('
        print()
        
    for y in range(W):
        print('
    print()
        
    print()

Solution (Python):
while True:
    h, w = map(int,input().split())
    if h == 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 & W==0:
        break

    for i in range(H):
        if i==0 or i==H-1:
            print('
        else:
            c_W='.'*(W-2)
            print('

    print('')

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

cnt = 0
ln = len(l)

while(cnt < ln):
    H = l[cnt][0]
    W = l[cnt][1]
    
    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()
            
    cnt += 1

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

    for h in range(0, height):
        for w in range(0, width):
            if 0 < h and h < height - 1 and 0 < w and w < width - 1:
                print('.', end='')
            else:
                print('
        print()
    print()

Solution (Python):
while (1):

    input_list = input().split(' ')
    h = int(input_list[0])
    w = int(input_list[1])

    if h == 0 and w == 0:
        break

    print('
    for i in range(h - 2):
        print('
    print('
    print('')

Solution (Python):
while True:
    h, w = [int(i) for i in 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 h in range(1,H+1):
        if (h==1 or h==H):
            for i in range(1,W+1):
                print('
            print('')
        else:
            for j in range(1,W+1):
                if j==1 or j==W:
                    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 tate in range(1,H+1):
            for yoko in range(1,W+1):
                if (tate == 1 or tate == H
                    or yoko == 1 or yoko == W):
                    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(W):
        print("
    print()
    for j in range(H-2):
        for k in range(W):
            if k==0 or k==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 j in range(1,H+1):
        if j==1 or j==H:
            for i in range(1,W+1):
                print('
            print()
        else:
            for i in range(1,W+1):
                if i==1 or i==W+1 or i%W==0:
                    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:
                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:
        break
    else:
        for y in range(H):
            if y == 0 or y == 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:
            for j in range(w):
                if j == 0 or j == w-1:
                    print("
                else:
                    print(".",end="")
            print()

    print()

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

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