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 in C# (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;

public class PrintAFrame
{
    //??????H cm ?????? W cm ???????´????????????¢?????????
    static void Main(string[] args)
    {
        /*---??£?¨???¨---*/
        int i;
        int k;
        int l;
        string[] strRectangleData;
        List<string> strRectangleList = new List<string>();
        /*---??£?¨???¨---*/

        /*??\???(H W)?????????{H W ????????????0?????´?????????}*/
        for(i = 0;;i++) {
            strRectangleList.Add(Console.ReadLine());
            strRectangleData = strRectangleList[i].Split(' ');
            if (strRectangleData[0] == "0" && strRectangleData[1] == "0"){
                break;
            }
        }

        /*????????????int?????§??´???*/
        int[,] intRectangleData = new int[strRectangleList.Count, 2];

        for (i = 0; i < strRectangleList.Count - 1; i++) {
            strRectangleData = strRectangleList[i].Split(' ');
            intRectangleData[i,0] = int.Parse(strRectangleData[0]);
            intRectangleData[i, 1] = int.Parse(strRectangleData[1]);
            }

        /*????????¢????????????[#]??§??¨???????????????[.]??§??¨???*/
        for (i = 0; i < strRectangleList.Count - 1; i++) {
            for (k = 0; k < intRectangleData[i, 0]; k++) {
                for (l = 0; l < intRectangleData[i, 1]; l++) {
                    if (k == 0 || k == intRectangleData[i, 0] - 1) {
                        Console.Write("#");
                    }
                    else if (l == 0 || l == intRectangleData[i, 1] - 1){
                        Console.Write("#");
                    }
                    else {
                        Console.Write(".");
                    }
                }
                Console.Write("\n");
            }
            Console.Write("\n");
        }
    }
}