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.Drawing;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Text;

namespace Fish.aidu
{
	public static class AiduOnlineJudge
	{
		public static string[] Split(string line)
		{
			return Regex.Split(line, " ");
		}
		public static int[] SplitToInts(string line)
		{
			return Regex.Split(line, " ").Select(x => int.Parse(x)).ToArray();
		}
		public static double[] SplitToDoubles(string line)
		{
			return Regex.Split(line, " ").Select(x => double.Parse(x)).ToArray();
		}
		public static long[] SplitToLongs(string line)
		{
			return Regex.Split(line, " ").Select(x => long.Parse(x)).ToArray();
		}
		public static int Main()
		{
			Compute(Console.In, Console.Out);
			return 0;
		}
		public static void Compute(TextReader reader, TextWriter writer)
		{
			string line = null;
			while (null != (line = reader.ReadLine()))
			{
				var values = SplitToInts(line);
				var h = values[0];
				var w = values[1];
				if (0 == h && 0 == w)
				{
					break;
				}
				
				for (int i = 0; i < h; i++)
				{
					if (i == 0 || i == h - 1)
					{
						writer.Write(new string('#', w));
					}
					else
					{
						for (int k = 0; k < w; k++)
						{
							if (k == 0 || k == w - 1)
							{
								writer.Write('#');
							}
							else
							{
								writer.Write('.');
							}
						}
					}
					writer.WriteLine();
				}
				writer.WriteLine();
			}
		}
	}
}