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 Ruby (judge verdict: Accepted)

#Print a Frame
def paints(arr)
	arr.each{|i|
		a = []
		i.each{|j|
			a << j
		}
		a[0].times{|k|
			if (k != 0 && k != (a[0] - 1))
				w_dotto_line = ''
				a[1].times{|l|
					if (l != 0 && l != (a[1] - 1))
						w_dotto_line << "."
					else
						w_dotto_line << '#'
					end
				}
				puts w_dotto_line
			else
				w_line = ''
				a[1].times{|l|
					w_line << '#'
				}
				puts w_line
			end
		}
		puts ''
	}
end

input_arr = []
while input = gets
	h, w = input.split(' ').map(&:to_i)
	break if (h == 0 && w == 0)
	input_arr << [h, w]
end

paints(input_arr)