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

j=0
for h in range(len(lists)//2): 
    for i in range(lists[2*j]):
        if i==0:
            for k in range(lists[2*j+1]-1):
                print("
            print("
        if i!=0 and i!=lists[2*j]-1:
            print("
            for k in range(lists[2*j+1]-2):
                print(".", end='')
            print("
        if i==lists[2*j]-1:
            for k in range(lists[2*j+1]-1):
                print("
            print("
    print("")
    j=j+1

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

Solution (Python):
while True:
    H,W=map(int,input().split())
    if H==0 or 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):
def print_flame(h,w):
    print("
    for _ in range(h-2):
        s = "
        print(s)
    print("
    print()

while True:
    h,w = map(int,input().split())
    if h+w == 0:
        break;
    print_flame(h,w)

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 j == W - 1 or i == 0 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 j in range(h):
        for i in range(w):
            if j == 0 or i == 0 or j == h-1 or i == 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 h in range(H):
        if h == 0 or h == H - 1:
            print('
            continue
        print('{}{}{}'.format('
    print()

Solution (Python):
h,w = [],[]
while True:
	a,b = map(int,input().split())
	if a == 0 and b == 0:
		break
	else:
		h.append(a)
		w.append(b)
for i in range(len(h)):
	print("
	for k in range(h[i]-2):
		print("
	print("
	print("")

Solution (Python):
while 1:
    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=(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:
            print('
        else:
            print('
    print()

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

for i in range(len(data)):
  for x in range(data[i][0]):
    if x != 0 and x != data[i][0]-1:
      print("
    else:
      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):
class Rectangle:
    def __init__(self,H,W):
        self.H = H
        self.W = W
    
    def draw(self):
        TB = "
        M = "
        print(TB)
        for h in range(self.H - 2):
            print(M)
        print(TB)

li = []
while 1:
    H, W =map(int,input().split())
    if H == W == 0:
        break
    else:
        li.append(Rectangle(H,W))

for l in li:
    l.draw()
    print("")

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

Solution (Python):
while(True):

    val1=input().split(" ")
    val2=[int(n) for n in val1]
    
    if val2 ==[0,0]:
        break
    else:
        for i in range(val2[0]):
            for j in range(val2[1]):
                if i>0 and j>0 and i < val2[0]-1 and j < val2[1]-1:
                    print(".",end="")
                else:
                    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):
s=[]
while True:
    tmp=list(map(int,input().split()))
    if tmp==[0,0]:
        break
    else:
        s.append(tmp)

for si in s:
    H,W=si[0],si[1]
    for i in range(H):
        if i==0 or i==H-1:
            print("
        else:
            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
	print("
	for i in range(H - 2):
		print("
	print("
	print()

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

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

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

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

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

Solution (Python):
H,W=map(int,input().split())
while(H>0 and W>0):
    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()
    H,W=map(int,input().split())

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

    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):
H,W=map(int,input().split())
while (W>0 and H>0):
    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()
    H,W=map(int,input().split())

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 j == 0 or i == H-1 or j == W-1:
                    print('
                else:
                    print('.', end='')
            print()
    print()

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

i = 0
while i < len(l):
  j = 0
  while j < l[i][0]:
    ans = ""
    if j == 0 or j == l[i][0]-1:
      for k in range(l[i][1]):
        ans += "
        k += 1
    else:
      ans += "
      for k in range (l[i][1]-2):
        ans += "."
        k += 1
      ans += "
    print(ans)
    j += 1
  i += 1
     
  print("")

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

Solution (Python):




def main():
    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()


if __name__ == '__main__':
    main()

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

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, w) == (0, 0):
        break
    else:
        for i in range(h):
            if i == 0:
                print('
            elif i == (h-1):
                print('
                print()
            else:
                print(f"

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
    else:
        for i in range(x):
            for j in range(y):
                if i == 0 or i == x - 1:
                    print("
                else:
                    if 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):
        print("
    print("
    print()

Solution (Python):
ans = []
add = ans.append
for line in open(0).readlines():
    H, W = map(int, line.split())
    if not H:
        break
    r = "
    add(r)
    add(("
    add(r)
    add("\n")
open(1, 'w').writelines(ans)

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

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

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

Solution (Python):
def DrawRectangle(lst):
    drawn=["."*lst[1] for i in range(lst[0])]
    for i in range(lst[0]):
        drawn[i]="
    drawn[0]="
    drawn[-1]="
    for i in drawn:
        print(i)
    print("")

a=[]
while True:
    a.append(list(map(int,input().split(" "))))
    if a[-1]==[0,0]:
        a=a[:-1]
        break
for i in a:
    DrawRectangle(i)

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:
    a,b = map(int, input().split())
    if a == 0 and b == 0:
        break
    for i in range(a):
        for j in range(b):
            if j == 0 or j == b-1 or i == 0 or i == a-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):
whs = []

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

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

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

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("
            else:
                if j==0 or j==w-1:
                    print("
                else:
                    print(".",end="")
        print()
    print()

Solution (Python):
for i in range(3000):
  h,w=(int(a) for a in input().split())
  if w==0 and h==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(".",sep="",end="")
    print("")
  print("")

Solution (Python):
while True:
    H,W = (int(x) for x in input().split())

    if (W == 0 and H == 0):
        exit()

    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(w):
        print("
    
    print()
    
    for i in range(1,h-1):
        print("
        for j in range(1,w-1):
            print(".",end="")
        print("
    
    for i in range(w):
        print("
    print("\n")

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

Solution (Python):
XS = list(map(int, open(0).read().split()))
for i in range(0, len(XS), 2):
    H = XS[i]
    W = XS[i+1]
    if H == 0 and W == 0:
        break
    print("
    for _ in range(H-2):
        print("
    print("
    print("")

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

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