1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from random import random
import sys, re

w, h = re.findall(r'\d+', sys.stdin.readline())
w, h = int(h), int(w)
if h < 3 or w < 3:
	print "Too small maze."
	sys.exit()

print "%i %i" % (w, h)
for i in range(1, h + 1):
	for j in range(1, w + 1):
		if i is 1 or j is 1 or i is w or j is w:
			sys.stdout.write("*")
		elif random() < 0.3:
			sys.stdout.write("*")
		else:
			sys.stdout.write(".")
	sys.stdout.write("\n")