//http://ja.doukaku.org/123/　投稿用
using System;
using System.Collections.Generic;
using System.Text;
class Program {
	static void Main(string[] args) {
		long tick = DateTime.Now.Ticks;
		const int X = 0;
		const int Y = 1;
		int xSize = int.Parse(args[0]);
		int ySize = int.Parse(args[1]);
		Random rnd = new Random();
		//注目点初期化
		int x = rnd.Next(0, xSize - 1) * 2 + 1;
		int y = rnd.Next(0, ySize - 1) * 2 + 1;
		List<int[]> canDigRoard = new List<int[]>();//注目点とすることが出来るセル
		bool[,] maze = new bool[xSize * 2 + 1, ySize * 2 + 1];//迷路データ　trueが道、falseが壁
		//全部壁にする
		for(int i = 0; i < maze.GetLength(X); i++) {
			for(int j = 0; j < maze.GetLength(Y); j++) {
				maze[i, j] = false;
			}
		}
		maze[x,y] = true;
		canDigRoard.Add(new int[] { x, y });
		//メインループ
		while(true) {
			int[][] directionList = new int[][] { 
				new int[] { -1, 0 }, 
				new int[] { 1, 0 }, 
				new int[] { 0, -1 }, 
				new int[] { 0, 1 } };
			int directionListLast = directionList.Length - 1;
			int[] direction;//方向
			do {
				int directionListIndex = rnd.Next(directionListLast);
				direction = directionList[directionListIndex];
				directionList[directionListIndex] = directionList[directionListLast--];
				if(maze.GetLength(X) > x + direction[X] * 2 && maze.GetLength(Y) > y + direction[Y] * 2 &&
					x + direction[X] * 2 >= 0 && y + direction[Y] * 2 >= 0) {//インデックスが範囲内か判定
					if(!(maze[x + direction[X] * 2, y + direction[Y] * 2])) {//2マス先が道かどうか
						maze[x + direction[X], y + direction[Y]] = true;
						maze[x + direction[X] * 2, y + direction[Y] * 2] = true;
						canDigRoard.Add(new int[] { x + direction[X] * 2, y + direction[Y] * 2 });
						break;
					}
				}
			} while(directionListLast != -1);
			if(directionListLast == -1){
				for(int i = 0; i < canDigRoard.Count; i++) {
					if(canDigRoard[i][X] == x && canDigRoard[i][Y] == y) {
						canDigRoard.RemoveAt(i);
					}
				}
				if(canDigRoard.Count == 0) break;
				int canDigRoardIndex = rnd.Next(0, canDigRoard.Count - 1);
				x = canDigRoard[canDigRoardIndex][X];
				y = canDigRoard[canDigRoardIndex][Y];
			} else {
				x += direction[X] * 2;
				y += direction[Y] * 2;
			}
		}
		string time = (DateTime.Now.Ticks - tick) / 10000L + "ms";
		//出力
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < maze.GetLength(Y); i++) {
			for(int j = 0; j < maze.GetLength(X); j++) {
				sb.Append(maze[j, i] ? "　" : "■");
			}
			sb.AppendLine();
		}
		Console.WriteLine(sb + time);
		Console.ReadLine();
	}
}