Fox Ciel starts to learn programming. The first task is drawing a fox! However, that turns out to be too hard for a beginner, so she decides to draw a snake instead.

A snake is a pattern on a n by m table. Denote c-th cell of r-th row as (r, c). The tail of the snake is located at (1, 1), then it's body extends to (1, m), then goes down 2 rows to (3, m), then goes left to (3, 1) and so on.

Your task is to draw this snake for Fox Ciel: the empty cells should be represented as dot characters ('.') and the snake cells should be filled with number signs ('#').

Consider sample tests in order to understand the snake pattern.


-----Input-----

The only line contains two integers: n and m (3 ≤ n, m ≤ 50). 

n is an odd number.


-----Output-----

Output n lines. Each line should contain a string consisting of m characters. Do not output spaces.


-----Examples-----
Input
3 3

Output
###
..#
###

Input
3 4

Output
####
...#
####

Input
5 3

Output
###
..#
###
#..
###

Input
9 9

Output
#########
........#
#########
#........
#########
........#
#########
#........
#########

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
(n, m) = map(int, input().split())
p = 0
q = 1
for i in range(3, n + 3):
	for j in range(1, m + 1):
		if i % 2 == 0:
			if i / 2 % 2 == 0:
				if j != m:
					print('.', end='')
				else:
					print('#')
			elif j == m:
				print('.')
			elif j != 1:
				print('.', end='')
			else:
				print('#', end='')
		elif j == m:
			print('#')
		else:
			print('#', end='')


flag = 1
(n, m) = map(int, input().split())
for _ in range(n // 2):
	print('#' * m)
	if flag == 1:
		print('.' * (m - 1) + '#')
		flag = 0
	else:
		print('#' + '.' * (m - 1))
		flag = 1
print('#' * m)


def main(rows, cols):
	if rows == 0 or cols == 0:
		return ''
	snake = []
	for i in range(rows):
		if i % 2 == 0:
			snake.append('#' * cols)
		elif i % 4 == 1:
			snake.append('.' * (cols - 1) + '#')
		elif i % 4 == 3:
			snake.append('#' + '.' * (cols - 1))
	return '\n'.join(snake)
vals = input().split()
(rows, cols) = (int(vals[0]), int(vals[1]))
print(main(rows, cols))


(r, c) = map(int, input().split())
l1 = ['#'] * c
l2 = ['.'] * c
l2[-1] = '#'
for i in range(r):
	if i % 2 == 0:
		for i in l1:
			print(i, end='')
	elif (i + 1) % 4 == 0 and i + 1 >= 4:
		for k in range(1, c + 1):
			print(l2[-k], end='')
	else:
		for i in l2:
			print(i, end='')
	print()


row = input().split()
r = int(row[0])
c = int(row[1])
x = 0
for i in range(r):
	if i % 2 != 0:
		if x is 0:
			print('.' * (c - 1) + '#')
			x = 1
		else:
			print('#' + '.' * (c - 1))
			x = 0
	else:
		print('#' * c)


(r, c) = list(map(int, input().split()))
a = []
for i in range(r // 2):
	a.append('#' * c)
	if i % 2 == 0:
		a.append('.' * (c - 1) + '#')
	else:
		a.append('#' + '.' * (c - 1))
print('\n'.join(a) + '\n' + '#' * c)


(a, b) = map(int, input().split())
c = 0
for i in range(1, a + 1):
	if i % 2 == 0:
		c = c + 1
	for j in range(1, b + 1):
		if i % 2 != 0:
			print('#', end='')
		elif c % 2 != 0 and j == b:
			print('#', end='')
		elif c % 2 == 0 and j == 1:
			print('#', end='')
		else:
			print('.', end='')
	print('')


(n, m) = map(int, input().split())
f = 1
c = 0
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 != 0:
			(print('#', end=''),)
		elif j == 1 and f == 0:
			(print('#', end=''),)
		elif j == m and f == 1:
			(print('#', end=''),)
		else:
			(print('.', end=''),)
	if f == 0 and i % 2 == 0:
		f = 1
	elif f == 1 and i % 2 == 0:
		f = 0
	print()


I = [int(i) for i in input().split()]

def snake(a, b):
	c = 0
	for i in range(1, a + 1):
		if i % 2 == 0:
			if c == 0:
				k = ''
				for j in range(b - 1):
					k = k + '.'
				c = 1
				k = k + '#'
				print(k)
			else:
				l = '#'
				for j in range(b - 1):
					l = l + '.'
				c = 0
				print(l)
		else:
			d = ''
			for i in range(b):
				d = d + '#'
			print(d)
snake(I[0], I[1])


(n, m) = map(int, input().split())
f = -1
for i in range(n):
	if i % 2:
		print(('#' + '.' * (m - 1))[::f])
		f *= -1
	else:
		print('#' * m)


(n, m) = map(int, input().split())
line = '#' * m
dots = '.' * (m - 1)
dots_first = True
for i in range(n):
	if i % 2 == 0:
		print(line)
	elif dots_first:
		print(dots + '#')
		dots_first = not dots_first
	else:
		print('#' + dots)
		dots_first = not dots_first


(a, b) = map(int, input().split())
for i in range(1, a + 1):
	if i % 4 == 2:
		print('.' * (b - 1) + '#', end='')
	elif i % 4 == 0:
		print('#' + '.' * (b - 1), end='')
	else:
		print('#' * b, end='')
	print()


(n, m) = input().split(' ')
n = int(n)
m = int(m)
i = 0
j = 0
left = True
while i < n:
	if i % 2 == 0:
		print('#' * m)
	else:
		if left == True:
			print('.' * (m - 1), end='')
			print('#')
		else:
			print('#', end='')
			print('.' * (m - 1))
		left = not left
	i += 1


(r, c) = input().split()
(r, c) = (int(r), int(c))
l = 1
u = 0
for i in range(1, r + 1):
	if i % 2 != 0:
		print('#' * c)
	elif l == 1 and u == 0:
		print((c - 1) * '.' + '#')
		l = 0
		u = 1
	elif l == 0 and u == 1:
		print('#' + (c - 1) * '.')
		l = 1
		u = 0


from sys import stdin
(x, y) = map(int, stdin.readline().split())
longs = '#' * y
short = '.' * (y - 1) + '#'
for i in range(x):
	if i % 4 == 1:
		print(short)
	elif i % 4 == 3:
		print(short[::-1])
	else:
		print(longs)


(n, m) = map(int, input().split(' '))
for i in range(n):
	if i % 4 == 3:
		s = '#' + '.' * (m - 1)
	elif i % 4 == 1:
		s = '.' * (m - 1) + '#'
	else:
		s = '#' * m
	print(s)


(n, m) = input().split()
(n, m) = (int(n), int(m))
print(m * '#')
j = 0
for i in range(n - 2):
	if i % 2 == 0:
		if j % 2 == 0:
			print((m - 1) * '.' + '#')
			j += 1
		else:
			print('#' + (m - 1) * '.')
			j += 1
	else:
		print(m * '#')
print(m * '#')


(n, m) = map(lambda x: int(x), input().split())
for i in range(n):
	if (i + 1) % 2 != 0:
		print('#' * m)
	elif (i + 1) % 2 == 0 and (i + 1) % 4 != 0:
		print('.' * (m - 1) + '#')
	elif (i + 1) % 2 == 0 and (i + 1) % 4 == 0:
		print('#' + '.' * (m - 1))


(n, m) = map(int, input().split())
count = 1
flag = 0
for i in range(n):
	if count % 2 == 0:
		if flag == 0:
			for j in range(m - 1):
				print('.', end='')
			print('#', end='')
			flag = 1
			count += 1
			print()
		else:
			print('#', end='')
			for j in range(m - 1):
				print('.', end='')
			flag = 0
			count += 1
			print()
	else:
		for j in range(m):
			print('#', end='')
		print()
		count += 1


(n, m) = map(int, input().split())
i = 1
while i <= n:
	j = 1
	while j <= m:
		if i % 2 == 0:
			a = i // 2
			if a % 2 != 0 and j == m:
				print('#', end='')
			elif a % 2 == 0 and j == 1:
				print('#', end='')
			else:
				print('.', end='')
		else:
			print('#', end='')
		j += 1
	print('')
	i += 1


fl = 0
(a, b) = [int(x) for x in input().split(' ')]
for i in range(a):
	if i % 2 == 0:
		print('#' * b)
	elif i % 2 == 1 and fl == 0:
		print('.' * (b - 1), end='')
		print('#')
		fl = 1
	elif i % 2 == 1 and fl == 1:
		print('#', end='')
		print('.' * (b - 1))
		fl = 0


def print_pattern(n, m):
	for i in range(n):
		for j in range(m):
			if i % 2 == 0:
				print('#', end='')
			elif i % 4 == 1 and j == m - 1:
				print('#', end='')
			elif i % 4 == 3 and j == 0:
				print('#', end='')
			else:
				print('.', end='')
		print()
(a, b) = map(int, input().split())
print_pattern(a, b)


(N, M) = list(map(int, input().split()))
R = True
for I in range(N):
	if (I + 1) % 2:
		print('#' * M)
	elif R:
		print('.' * (M - 1) + '#')
		R = False
	else:
		print('#' + '.' * (M - 1))
		R = True


(n, m) = map(int, input().split())
n -= 2
print('#' * m)
flag = True
while n > 0:
	if flag:
		print('.' * (m - 1) + '#')
		print('#' * m)
		flag = False
		n -= 2
	else:
		print('#' + '.' * (m - 1))
		print('#' * m)
		flag = True
		n -= 2


(n, m) = map(int, input().split(' '))
(pos, i, j) = (False, 0, 0)
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif not pos and j == m - 1 or (pos and j == 0):
			print('#', end='')
		else:
			print('.', end='')
	if i % 2:
		pos = not pos
	print('')


(x, y) = [int(i) for i in input().split(' ')]
for j in range(1, x + 1):
	if j % 2 == 1:
		print('#' * y)
	elif j % 4 == 2:
		print('.' * (y - 1) + '#')
	elif j % 4 == 0:
		print('#' + '.' * (y - 1))


z = []
a = [int(i) for i in input().split()]
for i in range(a[0] + 1):
	if i > 0:
		if i % 2 == 1:
			z.append('#' * a[1])
		elif i % 4 == 0:
			z.append('#' + '.' * (a[1] - 1))
		else:
			z.append('.' * (a[1] - 1) + '#')
for i in range(a[0]):
	print(z[i])


(n, m) = [int(i) for i in input().split()]
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


(n, m) = [int(i) for i in input().split()]
if (3 <= n and m <= 50) and n % 2 != 0:
	c = 0
	for i in range(1, n + 1):
		if i % 2 != 0:
			for j in range(m):
				print('#', end='')
		if i % 2 == 0:
			if c % 2 == 0:
				c += 1
				for j in range(m - 1):
					print('.', end='')
				print('#', end='')
			elif c % 2 != 0:
				for j in range(m):
					if j == 0:
						print('#', end='')
					else:
						print('.', end='')
				c += 1
		print()


(n, m) = map(int, input().split())
s = '#'
o = ''
e = '#'
for i in range(1, m):
	s += '#'
	o += '.'
	e += '.'
o += '#'
print(s)
for i in range(n // 2):
	if i % 2 == 1:
		print(e)
		print(s)
	else:
		print(o)
		print(s)


(s, m) = map(int, input().split())
for i in range(s):
	print(['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)][i % 4])


(n, m) = map(int, input().split())
h = ['#'] * m
t = ['.'] * (m - 1) + ['#']
k = ['#'] + ['.'] * (m - 1)
h = ''.join(h)
t = ''.join(t)
k = ''.join(k)
if n % 4 == 1:
	for i in range(n // 4):
		print(h)
		print(t)
		print(h)
		print(k)
	print(h)
elif n == 3:
	print(h)
	print(t)
	print(h)
else:
	for i in range(n // 4):
		print(h)
		print(t)
		print(h)
		print(k)
	print(h)
	print(t)
	print(h)


from sys import stdin, stdout
import re
(n, m) = [int(x) for x in stdin.read().rstrip().split()]
snake_body = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
snake_body_len = len(snake_body)
for i in range(n):
	print(snake_body[i % snake_body_len])


(n, m) = list(map(int, input().split()))
t = 0
for i in range(1, n + 1):
	if i % 2 == 0:
		t += 1
		if t % 2 == 0:
			print('#' + '.' * (m - 1))
		else:
			print('.' * (m - 1) + '#')
	else:
		print('#' * m)


(n, m) = [int(i) for i in input().split()]
res = ''
side = 1
for i in range(0, n):
	mod = False
	for j in range(m):
		if i % 2 != 0:
			mod = True
			if j == 0 and side == -1:
				res += '#'
			elif j + 1 == m and side == 1:
				res += '#'
			else:
				res += '.'
		else:
			res += '#'
	if mod:
		side *= -1
	print(res)
	res = ''


(a, b) = map(int, input().split())
c = 0
for i in range(1, a + 1):
	if i % 2 == 0:
		if c == 0:
			print('.' * (b - 1) + '#')
			c = 1
		else:
			print('#' + (b - 1) * '.')
			c = 0
	else:
		print('#' * b)


a = [int(i) for i in input().split()]
n = a[0]
m = a[1]
output = [['.' for j in range(m)] for i in range(n)]
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			output[i][j] = '#'
		elif i % 4 == 1:
			output[i][m - 1] = '#'
		elif i % 4 == 3:
			output[i][0] = '#'
for i in range(n):
	out = str(output[i])[1:-1]
	out = out.replace("'", '')
	out = out.replace(', ', '')
	print(out)


(n, m) = map(int, input().split())
b = 1
for i in range(n):
	a = i
	a += 1
	if a % 2 == 1:
		for j in range(m):
			print('#', end='')
		print()
	else:
		if b % 2 == 0:
			print('#', end='')
			for j in range(m - 1):
				print('.', end='')
			print()
		else:
			for j in range(m - 1):
				print('.', end='')
			print('#')
		b += 1


a = input().split()
n = int(a[0])
m = int(a[1])
s = []
for i in range(1, n + 1):
	t = []
	for j in range(m):
		t.append('.')
	s.append(t)
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 != 0:
			s[i - 1][j - 1] = '#'
		elif i % 4 == 0 and j == 1:
			s[i - 1][j - 1] = '#'
		elif i % 4 != 0 and i % 2 == 0 and (j == m):
			s[i - 1][j - 1] = '#'
for i in range(n):
	print(''.join(s[i]))


nm = [int(s) for s in input().split()]
n = nm[0]
m = nm[1]
A = '#' * m
direction = 1
for i in range(n):
	if i & 1:
		if direction == 1:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		direction = -direction
	else:
		print(A)


(n, m) = map(int, input().split())
flag = 0
for i in range(n):
	flag1 = 1
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif flag == 1 and flag1 != 0 and (j == 0):
			print('#', end='')
			flag = 0
			flag1 -= 1
		elif j != m - 1:
			print('.', end='')
		elif flag1 != 0:
			print('#', end='')
			flag1 -= 1
			flag = 1
		else:
			print('.', end='')
	print()


x = [int(item) for item in input().split()]
a = x[0]
b = x[1]
for item in range(1, a + 1):
	if item % 2 != 0:
		print('#' * b)
	elif item % 4 == 0:
		print('#' + '.' * (b - 1))
	else:
		print('.' * (b - 1) + '#')


(n, m) = list(map(int, input().split()))
res = ''
ind = 'l'
for i in range(n):
	if i % 2 == 0:
		res += '#' * m + '\n'
	elif ind == 'l':
		res += '.' * (m - 1) + '#\n'
		ind = 'f'
	else:
		res += '#' + '.' * (m - 1) + '\n'
		ind = 'l'
print(res.rstrip())


(n, m) = [int(i) for i in input().split(' ')]
snake_path = '#' * m
right_down = '.' * (m - 1) + '#'
left_down = '#' + '.' * (m - 1)
count = 1
for i in range(0, n):
	if (i + 1) % 2 != 0:
		print(snake_path)
	else:
		if count % 2 == 0:
			print(left_down)
		else:
			print(right_down)
		count += 1


(n, m) = map(int, input().split())
row1 = '#' * 1 + '.' * (m - 1)
row2 = '.' * (m - 1) + '#' * 1
row = row2
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	else:
		print(row)
		if row == row1:
			row = row2
		else:
			row = row1


nums = [int(i) for i in input().split()]
n = nums[0]
m = nums[1]
for i in range(n):
	string = ''
	if (i + 1) % 2 != 0:
		for i in range(m):
			string += '#'
		print(string)
	elif (i + 1) % 2 == 0 and (i + 1) % 4 == 0:
		string = '#'
		for i in range(m - 1):
			string += '.'
		print(string)
	elif (i + 1) % 2 == 0 and (i + 1) % 4 != 0:
		for i in range(m - 1):
			string += '.'
		string += '#'
		print(string)


read = lambda : map(int, input().split())
(n, m) = read()
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	elif i % 4 == 3:
		print('#' + '.' * (m - 1))


(n, m) = map(int, input().split())
count = 1
while count < n + 1:
	if count % 2 == 0 and count % 4 != 0:
		for j in range(1, m):
			print('.', end='')
		print('#')
		count += 1
	elif count % 4 == 0:
		print('#', end='')
		for j in range(2, m + 1):
			print('.', end='')
		print()
		count += 1
	else:
		for i in range(1, m + 1):
			print('#', end='')
		print()
		count += 1


def snakes(n, m):
	for i in range(0, n):
		for j in range(1, m + 1):
			snake = False
			if i % 2 == 0:
				snake = True
			else:
				if i % 4 == 1:
					snake = j == m
				if i % 4 == 3:
					snake = j == 1
			print('#' if snake is True else '.', end='')
		print()
(n, m) = input().split()
snakes(int(n), int(m))


(n, m) = input().split()
(n, m) = (int(n), int(m))
lt = []
for i in range(1, n + 1):
	if i % 2 == 1:
		ct = ['#'] * m
		lt.append(ct)
	else:
		k = i // 2
		if k % 2 == 0:
			ct = ['#'] + ['.'] * (m - 1)
			lt.append(ct)
		else:
			ct = ['.'] * (m - 1) + ['#']
			lt.append(ct)
for c in lt:
	print(*c, sep='')


def main():
	(n, m) = map(int, input().split())
	for i in range(1, n + 1):
		if i % 2 != 0:
			print('#' * m)
		elif i // 2 % 2 != 0:
			print(f"{'.' * (m - 1)}#")
		else:
			print(f"#{'.' * (m - 1)}")
main()


(r, col) = [int(x) for x in input().split(' ')]
for row in range(1, r + 1):
	if row % 2:
		print('#' * col)
	elif row % 4 == 2:
		print((col - 1) * '.' + '#')
	elif row % 4 == 0:
		print('#' + '.' * (col - 1))


(n, m) = input().split(' ')
(n, m) = (int(n), int(m))
a = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print('#', end='')
		print()
	elif i % 2 and a == 0:
		a = 1
		for j in range(m - 1):
			print('.', end='')
		print('#', end='')
		print()
	elif i % 2 and a == 1:
		a = 0
		print('#', end='')
		for j in range(m - 1):
			print('.', end='')
		print()


(n, m) = map(int, input().split())
right = True
row = 1
while row < n + 1:
	mstring = ''
	col = 1
	if row % 2 != 0:
		while col < m + 1:
			mstring += '#'
			col += 1
		print(mstring)
	elif row % 2 == 0 and right:
		while col < m:
			mstring += '.'
			col += 1
		right = False
		mstring += '#'
		print(mstring)
	elif row % 2 == 0 and (not right):
		mstring += '#'
		while col < m:
			mstring += '.'
			col += 1
		print(mstring)
		right = True
	row += 1


(n, k) = [int(i) for i in input().split()]
for i in range(0, n):
	if i / 2 == i // 2:
		a = ['#'] * k
		print(''.join(a))
	elif i % 4 == 1:
		a = ['.'] * (k - 1) + ['#']
		print(''.join(a))
	else:
		a = ['#'] + ['.'] * (k - 1)
		print(''.join(a))


def main():
	(lines, length) = [int(i) for i in input().split(' ')]
	for i in range(1, lines + 1):
		if i % 2 != 0:
			print('#' * length)
		elif i % 4 == 0:
			print('#' + '.' * (length - 1))
		else:
			print('.' * (length - 1) + '#')
main()


(l, b) = map(int, input().split())
t = 0
for i in range(l):
	if i % 2 == 0:
		print('#' * b)
	elif t == 0:
		print('.' * (b - 1) + '#')
		t = 1
	else:
		print('#' + '.' * (b - 1))
		t = 0


import sys
(n, m) = map(int, sys.stdin.readline().split())
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


(h, w) = map(int, input().split())
for i in range(h):
	if i % 2 == 0:
		print('#' * w)
	elif i % 4 == 1:
		print('.' * (w - 1) + '#')
	else:
		print('#' + '.' * (w - 1))


(n, k) = list(map(int, input().split()))
a = '.' * (k - 1)
b = '#'
for i in range(1, n + 1):
	if i % 2 != 0:
		print(b * k)
	if i % 2 == 0:
		if i % 4 == 0:
			print(b + a)
		else:
			print(a + b)


(n, m) = [int(i) for i in input().split()]
nd = 0
for i in range(0, n):
	if i % 2 == 0:
		print('#' * m)
	elif nd == 0:
		print('.' * (m - 1), '#', sep='')
		nd = 1
	else:
		nd = 0
		print('#', '.' * (m - 1), sep='')


(n, m) = map(int, input().split())
a = '.' * (m - 1)
b = '#'
c = '#' * m
for x in range(n):
	if x % 2 == 0:
		print(c)
	else:
		print('{}{}'.format(a, b))
		(a, b) = (b, a)


(n, m) = map(int, input().split(' '))
snake = []
right = True
for i in range(1, n + 1):
	if i % 2 == 1:
		line = ''
		line += '#' * m
	elif right:
		right = False
		line = '.' * (m - 1) + '#'
	else:
		right = True
		line = '#' + '.' * (m - 1)
	snake.append(line)
for i in snake:
	print(i)


(n, m) = map(int, input().split())
for i in range(n):
	for j in range(m):
		if i % 2 == 0 or (j == m - 1 and i % 4 == 1) or (j == 0 and i % 4 == 3):
			print('#', end='')
		else:
			print('.', end='')
	print()


(r, c) = map(int, input().split())
l = []
count = 1
for i in range(r):
	k = [0] * c
	x = 0
	for j in range(c):
		if count % 2 != 0:
			print('#', end='')
		elif count % 2 == 0 and count % 4 != 0:
			if x != c - 1:
				x = x + 1
				print('.', end='')
			else:
				print('#', end='')
		elif x == 0:
			print('#', end='')
			x += 1
		else:
			print('.', end='')
	count += 1
	print()


(n, m) = (int(i) for i in input().split())
a = [['.' for i in range(m)] for i in range(n)]
a[0][0] = '#'
i = 0
while i < n:
	if a[i][0] == '#':
		for j in range(0, m):
			a[i][j] = '#'
	elif a[i][m - 1] == '#':
		for j in range(m - 1, -1, -1):
			a[i][j] = '#'
	if i + 1 <= n - 1:
		a[i + 1][j] = '#'
	if i + 2 <= n - 1:
		a[i + 2][j] = '#'
	i = i + 2
for i in a:
	print(''.join(i))


(n, m) = map(int, input().split())
s = '.' * (m - 1) + '#'
for i in range(0, n):
	if i % 2 == 0:
		print('#' * m)
	else:
		print(s)
		s = s[::-1]


def pagar(n):
	for i in range(n):
		print('#', end='')

def titik(n):
	for i in range(n):
		print('.', end='')
tp = str(input()).split()
n = int(tp[0])
m = int(tp[1])
for i in range(0, n):
	if i % 2 == 0:
		pagar(m)
	elif int((i + 1) / 2) % 2 == 1:
		titik(m - 1)
		pagar(1)
	else:
		pagar(1)
		titik(m - 1)
	print()


import sys
(n, m) = map(int, sys.stdin.readline().split())
i = 1
while i <= n:
	j = 1
	while j <= m:
		if i % 2 == 1 and j < m:
			(print('#', end=''),)
		elif i % 2 == 1 and j == m:
			print('#')
		elif i % 2 == 0 and i % 4 != 0:
			if j != m:
				(print('.', end=''),)
			else:
				print('#')
		elif i % 4 == 0:
			if j == 1:
				(print('#', end=''),)
			elif j != m:
				(print('.', end=''),)
			else:
				print('.')
		j += 1
	i += 1


data = input()
list = data.split(' ')
first = int(list[0])
last = int(list[1])
for i in range(first):
	for j in range(last):
		if (i + 1) % 2 != 0:
			print('#', end='')
		elif (i + 1) % 2 == 0 and (i + 1) / 2 % 2 != 0 and (j != last - 1):
			print('.', end='')
		elif (i + 1) % 2 == 0 and (i + 1) / 2 % 2 != 0 and (j == last - 1):
			print('#', end='')
		elif (i + 1) % 2 == 0 and (i + 1) / 2 % 2 == 0 and (j != 0):
			print('.', end='')
		elif (i + 1) % 2 == 0 and (i + 1) / 2 % 2 == 0 and (j == 0):
			print('#', end='')
	print('')


(n, m) = map(int, input().split())
r = ''
ec = ''
oc = ''
for i in range(m):
	r += '#'
	if i == 0:
		oc = '#'
	else:
		oc += '.'
	if i == m - 1:
		ec += '#'
	else:
		ec += '.'
even = 1
while n != 0:
	if n % 2 != 0:
		print(r)
	elif n % 2 == 0 and even % 2 == 0:
		print(oc)
		even += 1
	else:
		print(ec)
		even += 1
	n -= 1


(n, m) = map(int, input().split())
hash = []
dots_h = []
h_dots = []
for i in range(0, m):
	hash.append('#')
for i in range(0, m - 1):
	dots_h.append('.')
dots_h.append('#')
h_dots.append('#')
for i in range(1, m):
	h_dots.append('.')
temp = 0
for i in range(0, n):
	if i % 2 == 0:
		print(''.join(hash))
	elif temp == 0:
		print(''.join(dots_h))
		temp = 1
	else:
		print(''.join(h_dots))
		temp = 0


(n, m) = [int(i) for i in input().split()]
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print('#', end='')
		print()
	if i % 4 == 1:
		for j in range(m - 1):
			print('.', end='')
		print('#')
	if i % 4 == 3:
		print('#', end='')
		for j in range(m - 1):
			print('.', end='')
		print()


(y, x) = input().split()
y = int(y)
x = int(x)
list = []
k = 1
for i in range(1, y + 1):
	if i % 2 != 0:
		for j in range(x):
			list.append('#')
	else:
		if k % 2 != 0:
			for j in range(x - 1):
				list.append('.')
			list.append('#')
		else:
			list.append('#')
			for j in range(x - 1):
				list.append('.')
		k += 1
for i in range(0, len(list), x):
	print(''.join(list[i:i + x]))


s = input('').split(' ')
(n, m) = (int(s[0]), int(s[1]))
L = [[] for i in range(n)]
for i in range(n):
	for j in range(m):
		L[i].append('.')
for k in range(0, n, 2):
	for i in range(m):
		L[k][i] = '#'
for j in range(1, n, 4):
	L[j][m - 1] = '#'
for j in range(3, n, 4):
	L[j][0] = '#'
for i in range(n):
	for j in range(m):
		print(L[i][j], end='')
	print()


__author__ = 'runekri3'
(rows, cols) = list(map(int, input().split()))
full_body = '#' * cols
left_body = '#' + '.' * (cols - 1)
right_body = '.' * (cols - 1) + '#'
for i in range(1, rows + 1):
	if i % 2 == 1:
		print(full_body)
	elif i % 4 == 0:
		print(left_body)
	else:
		print(right_body)


(n, m) = map(int, input().split(' '))
for k in range(1, n + 1):
	if k % 2 != 0:
		print('#' * m)
	elif k // 2 % 2 != 0:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


size = list(map(int, input().split()))
right = True
for i in range(size[0]):
	if i % 2 == 0:
		print('#' * size[1])
	elif right == True:
		print('.' * (size[1] - 1) + '#')
		right = False
	else:
		print('#' + (size[1] - 1) * '.')
		right = True


(n, m) = map(int, input().split(' '))
full_body_line = '#' * m
right_body_line = '.' * (m - 1) + '#'
left_body_line = '#' + '.' * (m - 1)
i = 1
for j in range(n):
	if i == 1:
		print(full_body_line)
		i = 2
	elif i == 2:
		print(right_body_line)
		i = 3
	elif i == 3:
		print(full_body_line)
		i = 4
	else:
		print(left_body_line)
		i = 1


(n, m) = map(int, input().split())
dir = 'r'
for i in range(1, n + 1):
	if i & 1:
		print('#' * m)
	elif dir == 'r':
		print('.' * (m - 1) + '#')
		dir = 'l'
	else:
		print('#' + '.' * (m - 1))
		dir = 'r'


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	a = []
	if i % 2 == 1:
		b = []
		b = ['#'] * m
		print(''.join(b))
	elif i % 4 == 0:
		b = []
		b = ['#']
		a = ['.'] * (m - 1)
		print(b[0] + ''.join(a))
	else:
		b = []
		b = ['#']
		a = ['.'] * (m - 1)
		print(''.join(a) + b[0])


(n, m) = map(int, input().split())
a = '#' * m + '\n'
b = '.' * (m - 1) + '#'
for i in range(n // 2):
	print(a + b)
	b = b[::-1]
print(a)


(n, m) = list(map(int, input().split()))
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	else:
		if i % 2 == 0 and i % 4 != 0:
			k = '.' * (m - 1) + '#'
		elif i % 4 == 0:
			k = '#' + '.' * (m - 1)
		print(k)


(n, m) = map(int, input().split(' '))
fl = 0
for i in range(1, n + 1):
	for j in range(0, m):
		if i % 2 != 0:
			print('#', end='')
			if j == m - 1:
				print()
		elif fl == 0:
			if j != m - 1:
				print('.', end='')
			else:
				print('#')
				fl = -1
		elif j == 0:
			print('#', end='')
		else:
			print('.', end='')
			if j == m - 1:
				print()
				fl = 0


(n, m) = map(int, input().split())
x = True
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	else:
		if x:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		x = not x


def snake(n, m):
	rows = []
	for i in range(1, n + 1):
		if i % 2:
			rows.append('#' * m)
		elif i % 4:
			rows.append('.' * (m - 1) + '#')
		else:
			rows.append('#' + '.' * (m - 1))
	return '\n'.join(rows)
(n, m) = map(int, input().split())
print(snake(n, m))


(b, a) = map(int, input().split())
(x, y, z) = ('', '', '')
m = 0
for i in range(a):
	x += '#'
	if i + 1 == a:
		y += '#'
	else:
		y += '.'
	if i == 0:
		z += '#'
	else:
		z += '.'
for i in range(1, b + 1):
	if i % 2 == 1:
		print(x)
	elif m == 0:
		print(y)
		m = 1
	else:
		print(z)
		m = 0


def create_table(n, m):
	return [['.' for k in range(m)] for i in range(n)]

def display_table(table):
	for row in table:
		print(''.join(row))

def create_snake(table):
	x = 0
	for i in range(len(table)):
		if (i + 1) % 2 != 0:
			table[i] = ['#' for k in range(len(table[i]))]
		else:
			x += 1
			if x % 2 != 0:
				table[i][-1] = '#'
			else:
				table[i][0] = '#'
	return table

def main():
	(n, m) = [int(i) for i in input().split()]
	table = create_table(n, m)
	snake_table = create_snake(table)
	display_table(snake_table)
main()


(n, m) = [int(x) for x in input().split()]
for i in range(n):
	if i % 2 is 0:
		k = 0
		while k < m:
			print('#', end='')
			k += 1
	elif i % 4 is 1:
		k = 0
		while k < m - 1:
			print('.', end='')
			k += 1
		print('#', end='')
	elif i % 4 is 3:
		print('#', end='')
		k = 0
		while k < m - 1:
			print('.', end='')
			k += 1
	print('')


def find(n, k):
	a = '#' * k
	b = '.' * (k - 1) + '#'
	c = '#' + '.' * (k - 1)
	temp = n
	while temp:
		if temp:
			print(a)
			temp = temp - 1
		if temp:
			print(b)
			temp = temp - 1
		if temp:
			print(a)
			temp = temp - 1
		if temp:
			print(c)
			temp = temp - 1
(n, k) = list(map(int, input().split()))
find(n, k)


def PrintSnake(n, m):
	countEven = 1
	finalResult = ''
	n = int(n)
	m = int(m)
	initialArray = [['#' for _ in range(0, m)] for _ in range(0, n)]
	for i in range(0, len(initialArray)):
		if i % 2 == 0:
			finalResult += ''.join(initialArray[i]) + '\n'
		else:
			if countEven % 2 != 0:
				for j in range(0, m - 1):
					finalResult += '.'
				finalResult += '#\n'
			else:
				finalResult += '#'
				for j in range(1, m):
					finalResult += '.'
				finalResult += '\n'
			countEven += 1
	return finalResult
n = input().split(' ')
print(PrintSnake(n[0], n[1]))


(n, m) = list(map(int, input().split()))
for i in range(1, n + 1):
	for j in range(m):
		if i % 2 != 0:
			print('#', end='', sep='')
		elif i % 4 != 0:
			if 0 <= j < m - 1:
				print('.', end='', sep='')
			else:
				print('#', end='', sep='')
		elif j == 0:
			print('#', end='', sep='')
		elif 1 <= j <= m:
			print('.', end='', sep='')
	print()


(n, m) = [int(x) for x in input().split()]
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	if i % 4 == 2:
		print('.' * (m - 1) + '#')
	if i % 4 == 0:
		print('#' + '.' * (m - 1))


(n, m) = [int(x) for x in input().split()]
cnt = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if cnt % 2 == 0:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		cnt += 1


line = input()
(N, M) = line.split()
(n, m) = (int(N), int(M))
list1 = []
c = n // 2 + 1
list3 = ['.'] * (m - 1)
list3.append('#')
list4 = ['#']
list4.extend(['.'] * (m - 1))
for i in range(0, c, 1):
	list1.append(['#'] * m)
for i in range(1, n - c + 1, 1):
	if i % 2 != 0:
		list1.insert(2 * i - 1, list3)
	else:
		list1.insert(2 * i - 1, list4)
for i in range(0, n, 1):
	for j in range(0, m, 1):
		print(list1[i][j], end='')
		if j == m - 1:
			print()


(n, m) = map(int, input().split())
k = 0
while k < n:
	if k % 2 == 0:
		print('#' * m)
	elif k % 4 == 1:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))
	k += 1


(n, m) = map(int, input().split())
output = ''
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 1:
			output += '#'
		elif i % 4 == 2:
			if j == m:
				output += '#'
			else:
				output += '.'
		elif j == 1:
			output += '#'
		else:
			output += '.'
	output += '\n'
print(output)


(y, x) = [int(x) for x in input().split()]
line_a = ''.join(['#'] * x)
line_b = ''.join(['.'] * (x - 1)).__add__('#')
line_c = ['#']
line_c.extend(['.'] * (x - 1))
line_c = ''.join(line_c)
sequence = [line_a, line_b, line_a, line_c] * (y // 3 + 1)
for i in range(y):
	print(sequence[i])


inp = input().split()
n = int(inp[0])
m = int(inp[1])
even = ['#'] * m
odda = ['.'] * (m - 1)
oddb = ['#']
for i in range(m - 1):
	oddb.append('.')
odda.append('#')
for i in range(n):
	if i % 2 == 0:
		print(''.join(even))
	elif i % 4 == 1:
		print(''.join(odda))
	else:
		print(''.join(oddb))


def solve(data):
	(n, m) = data
	hash = '#' * m
	empty = '.' * (m - 1)
	isRight = True
	for i in range(n):
		if i % 2 == 0:
			print(hash)
		else:
			if not isRight:
				print('#' + empty)
			else:
				print(empty + '#')
			isRight = not isRight
solve(list(map(int, input().split(' '))))


(lines, columns) = (int(x) for x in input().split())

def print_left(columns):
	print('#' + '.' * (columns - 1))

def print_right(columns):
	print('.' * (columns - 1) + '#')

def print_full(columns):
	print('#' * columns)
for i in range(lines):
	if i % 2 == 0:
		print_full(columns)
	elif i % 4 == 1:
		print_right(columns)
	else:
		print_left(columns)


(r, c) = map(int, input().split())
j = 0
for i in range(r):
	if i % 2 == 0:
		a = ['#'] * c
		print(''.join(a))
	elif j % 4 == 1:
		a = ['.'] * c
		a[-1] = '#'
		print(''.join(a))
	else:
		a = ['.'] * c
		a[0] = '#'
		print(''.join(a))
	j += 1


(n, m) = [int(i) for i in input().split()]
dot = '.' * (m - 1) + '#'
for i in range(n):
	if i % 2:
		print(dot)
		dot = dot[::-1]
	else:
		print('#' * m)


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	elif i / 2 % 2 == 1:
		print('.' * (m - 1), '#', sep='')
	else:
		print('#', '.' * (m - 1), sep='')


(n, m) = list(map(int, input().split()))
for i in range(n):
	if i % 2 == 0:
		for i in range(m):
			print('#', end='')
		print('')
	elif not (i + 1) // 2 % 2 == 0:
		for i in range(m - 1):
			print('.', end='')
		print('#')
	else:
		print('#', end='')
		for i in range(m - 1):
			print('.', end='')
		print('')


(r, c) = map(int, input().split(' '))
flag = 0
for i in range(0, r):
	if i % 2 == 1 and flag == 0:
		flag = 1
		print((c - 1) * '.' + '#')
	elif i % 2 == 1 and flag == 1:
		flag = 0
		print('#' + (c - 1) * '.')
	else:
		print(c * '#')


(n, m) = map(int, input().split())
(s, k) = (['#'] * m, ['.'] * (m - 1))
k.append('#')
l = k[::-1]
print(''.join(s))
print(''.join(k))
flag = 1
for x in range(3, n + 1):
	if x % 2:
		print(''.join(s))
	elif flag:
		print(''.join(l))
		flag ^= 1
	else:
		print(''.join(k))
		flag ^= 1


(n, m) = [int(__) for __ in input().strip().split()]
r = True
for _ in range(n):
	if _ % 2 == 0:
		print('#' * m)
	else:
		print('.' * (m - 1) + '#' if r else '#' + '.' * (m - 1))
		r = not r


(n, m) = map(int, input().split())
a = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
for i in range(n):
	print(a[i % 4])


inp = input().split()
for x in range(1, int(inp[0]) + 1):
	if x % 2 != 0:
		print('#' * int(inp[1]))
	elif x % 2 == 0 and x // 2 % 2 == 0:
		print('#' + '.' * (int(inp[1]) - 1))
	else:
		print('.' * (int(inp[1]) - 1) + '#')


(i, j) = map(int, input().split(' '))
t = '#' * j
l = '#' + '.' * (j - 1)
for k in range(i):
	if k % 2 == 0:
		print(t)
	else:
		l = l[::-1]
		print(l)


(k, l) = map(int, input().split())
for i in range(1, k + 1):
	if i % 4 == 2:
		print('.' * (l - 1) + '#')
	elif i % 4 == 0:
		print('#' + '.' * (l - 1))
	else:
		print(l * '#')


a = input().split(' ')
n = int(a[0])
m = int(a[1])
F = [['.'] * m for i in range(n)]
for i in range(n):
	for j in range(m):
		if i % 2 == 0 or (i % 4 == 1 and j == m - 1) or (i % 4 == 3 and j == 0):
			F[i][j] = '#'
for row in F:
	print(''.join(row))


(r, c) = map(int, input().split())
m = 0
for k in range(1, r + 1):
	if k % 2 == 0:
		if m == 0:
			print('.' * (c - 1) + '#')
			m = 1
		else:
			print('#' + '.' * (c - 1))
			m = 0
	else:
		print('#' * c)


x = input('').split()
(n, m) = [int(i) for i in x]
k = 0
for i in range(1, n + 1, 1):
	for j in range(1, m + 1, 1):
		if i % 2 != 0:
			print('#', end='')
		else:
			if i % 2 == 0 and i % 4 == 0:
				k = 1
			elif i % 2 == 0:
				k = m
			if k != j:
				print('.', end='')
			else:
				print('#', end='')
	print()


(n, m) = map(int, input().split())
for j in range(n):
	P = ''
	for k in range(m - 1):
		if j % 2 == 0:
			P += '#'
		else:
			P += '.'
	P += '#'
	if j // 2 % 2 == 1:
		P = P[::-1]
	print(P)


temp = input().split()
n = int(temp[0])
m = int(temp[1])
flag = 'right'
for i in range(n):
	s = ''
	if i % 2 == 1:
		if flag == 'right':
			for i in range(m - 1):
				s = s + '.'
			s = s + '#'
			flag = 'left'
		else:
			s = s + '#'
			for i in range(m - 1):
				s = s + '.'
			flag = 'right'
	else:
		for i in range(m):
			s = s + '#'
	print(s)


(n, m) = map(int, input().split())
x = '#'
y = '.'
toggle = 0
for i in range(n):
	if i % 2 == 0:
		print(x * m)
	elif toggle == 0:
		print(y * (m - 1) + x)
		toggle = 1
	else:
		print(x + y * (m - 1))
		toggle = 0


(a, b) = map(int, input().split())
body = ''.join(['#'] * b)
space = ''.join(['.'] * (b - 1))
k = 0
for i in range(a):
	if (i + 1) % 2 == 1:
		print(body)
	elif (i + 1) % 4 != 0:
		print(space + '#')
	else:
		print('#' + space)


(n, m) = map(int, input().split())
arr = [['.' for j in range(m)] for i in range(n)]
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			arr[i][j] = '#'
		if i % 4 == 1:
			arr[i][m - 1] = '#'
		if i % 4 == 3:
			arr[i][0] = '#'
for i in range(n):
	print(''.join(arr[i]))


def main():
	(n, m) = map(int, input().split())
	for i in range(n):
		s = ''
		for j in range(m):
			if i % 2 == 0:
				s += '#'
			elif i % 4 == 1 and j != m - 1:
				s += '.'
			elif i % 4 == 1 and j == m - 1:
				s += '#'
			elif i % 4 == 3 and j:
				s += '.'
			elif i % 4 == 3 and j == 0:
				s += '#'
		print(s)
main()


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(m):
			print('#', end='')
		print()
	elif i % 4 == 0:
		print('#', end='')
		for k in range(m - 1):
			print('.', end='')
		print()
	else:
		for c in range(m - 1):
			print('.', end='')
		print('#')


(n, m) = map(int, input().split())
a = []
for i in range(n):
	if i % 2 == 0:
		a.append(['#'] * m)
	else:
		a.append(['.'] * m)
		if (i + 1) // 2 % 2 == 1:
			a[i][-1] = '#'
		else:
			a[i][0] = '#'
for i in a:
	print(*i, sep='')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
(m, n) = mi()
for i in range(m):
	for j in range(n):
		if (i + 1) % 4 == 0:
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
		elif (i + 1) % 4 == 2:
			if j != n - 1:
				print('.', end='')
			else:
				print('#', end='')
		else:
			print('#', end='')
	print()


(n, m) = map(int, input().split())
list1 = ['#' for k in range(m)]
list2 = ['#'] + ['.' for k in range(m - 1)]
list3 = ['.' for k in range(m - 1)] + ['#']
for k in range(1, n + 1):
	if k % 2 != 0:
		print(''.join(list1))
	elif k % 4 != 0:
		print(''.join(list3))
	else:
		print(''.join(list2))


def read_nums():
	return [int(x) for x in input().split()]

def main():
	(n, m) = read_nums()
	for i in range(n):
		for j in range(m):
			if i % 2 == 0:
				print('#', end='')
			elif i % 4 == 1:
				if j == m - 1:
					print('#', end='')
				else:
					print('.', end='')
			elif j == 0:
				print('#', end='')
			else:
				print('.', end='')
		print('')
main()


(n, m) = map(int, input().split())
s = '#'
fillchar = '.'
for i in range(1, n + 1):
	if i % 4 == 0:
		print(s.ljust(m, fillchar))
	elif i % 2 == 0 and i % 4 != 0:
		print(s.rjust(m, fillchar))
	elif i % 2 != 0:
		print(s * m)


cor = input()
n = cor.split(' ')
x = int(n[1])
y = int(n[0])
line1 = '#' * x
line2 = '.' * (x - 1) + '#'
line3 = '#' * x
line4 = '#' + '.' * (x - 1)
line = [line1, line2, line3, line4] * 1000
for i in range(1000):
	if y == 2 * i + 1:
		for k in range(0, y):
			print(line[k])


l = [int(x) for x in input().split()]
for i in range(0, l[0]):
	if i % 2 == 0:
		print('#' * l[1])
	elif i % 4 == 1:
		print('.' * (l[1] - 1) + '#')
	else:
		print('#' + '.' * (l[1] - 1))


(n, m) = map(int, input().split())
l1 = ['#'] * m
l2 = ['.'] * (m - 1) + ['#']
l2 = l2[::-1]
for i in range(n):
	if i % 2 == 0:
		print(''.join(l1))
	else:
		l2.reverse()
		print(''.join(l2))


data = [int(info) for info in input().split(' ')]
left = True
output = []
for i in range(0, data[0]):
	if i % 2 == 1:
		if not left:
			output.append('#' + '.' * (data[1] - 1))
			left = True
		else:
			output.append('.' * (data[1] - 1) + '#')
			left = False
	else:
		output.append('#' * data[1])
for i in output:
	print(''.join(i))


(n, m) = [int(x) for x in input().split()]
flip = False
for i in range(1, n + 1):
	if i % 2 != 0:
		print(m * '#')
	elif flip == False:
		print('.' * (m - 1) + '#')
		flip = True
	elif flip == True:
		print('#' + '.' * (m - 1))
		flip = False


(m, n) = map(int, input().split())
(str1, str2, str3) = ('', '', '')
for i in range(n):
	str1 = str1 + '#'
	if i == 0:
		str2 = str2 + '#'
	else:
		str2 = str2 + '.'
	if i == n - 1:
		str3 = str3 + '#'
	else:
		str3 = str3 + '.'
for i2 in range(1, m + 1):
	if i2 % 2 != 0:
		print(str1)
	elif i2 % 4 == 0:
		print(str2)
	else:
		print(str3)


(a, b) = map(int, input().split())
z = '#' * b
m = '#' + '.' * (b - 1)
n = '.' * (b - 1) + '#'
h = 0
f = 1
while h < a:
	if h % 2 == 0:
		print(z)
	elif f == 1:
		print(n)
		f = 0
	else:
		print(m)
		f = 1
	h += 1


(y, x) = map(int, input().split())
for y_index in range(y):
	for x_index in range(x):
		if y_index % 2 == 0:
			print('#', end='')
		elif y_index % 4 == 1 and x_index == x - 1:
			print('#', end='')
		elif y_index % 4 == 3 and x_index == 0:
			print('#', end='')
		else:
			print('.', end='')
	print()


(n, m) = [int(i) for i in input().split()]
right = True
for i in range(n):
	string = ''
	for j in range(m):
		if i % 2 == 0:
			string += '#'
		elif right:
			if j == m - 1:
				string += '#'
			else:
				string += '.'
		elif j == 0:
			string += '#'
		else:
			string += '.'
	if i % 2:
		right = not right
	print(string)


(n, m) = map(int, input().split())
last = False
for i in range(n):
	if i % 2 == 0:
		print(''.join(['#'] * m))
	else:
		if not last:
			print(''.join(['.'] * (m - 1)) + '#')
		else:
			print('#' + ''.join(['.'] * (m - 1)))
		last = not last


(m, n) = map(int, input().split())
a = 1
while a <= m:
	if a % 2 != 0:
		print('#' * n)
	elif a % 4 == 0:
		print('#', end='')
		print('.' * (n - 1))
	elif a % 2 == 0:
		print('.' * (n - 1), end='')
		print('#')
	a += 1


(n, m) = list(map(int, input().split()))
f = True
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif f == True:
		print('.' * (m - 1) + '#')
		f = False
	else:
		print('#' + '.' * (m - 1))
		f = True


(n, m) = map(int, input().split())
re = 1.5
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(m):
			print('#', end='')
		print()
	elif i % 2 == 0 and re % 2 == 0:
		for j in range(m - 1):
			print('.', end='')
		print('#', end='')
		print()
	elif i % 2 == 0 and re % 2 != 0:
		print('#', end='')
		for k in range(m - 1):
			print('.', end='')
		print()
	re += 0.5


(r, c) = map(int, input().split())
for i in range(r):
	if i % 2 == 0:
		print(c * '#')
	elif i % 4 == 3:
		print('#' + (c - 1) * '.')
	else:
		print((c - 1) * '.' + '#')


(n, m) = [int(i) for i in input().split()]
mid = str()
right = str()
left = str()
for i in range(m):
	mid = mid + '#'
	if i == 0:
		left = '#'
	else:
		left = left + '.'
	if i == m - 1:
		right = right + '#'
	else:
		right = right + '.'
for i in range(n):
	if i % 2 == 0:
		print(mid)
	elif i % 4 == 1:
		print(right)
	else:
		print(left)


(b, a) = map(int, input().split())
k = 0
q = 0
for i in range(int(b / 2) + 1):
	print(a * '#')
	if k < int(b / 2):
		if q == 0:
			for w in range(int(b / 2)):
				print((a - 1) * '.' + '#')
				q += 1
				break
		else:
			for r in range(int(b / 2)):
				print('#' + (a - 1) * '.')
				q = 0
				break
	k += 1


(r, c) = map(int, input().split())
k = '#' * c
l = '.' * (c - 1)
l += '#'
m = '#'
m += '.' * (c - 1)
for i in range(1, r + 1):
	if i % 2 != 0:
		print(k)
	if i % 4 == 0:
		print(m)
		continue
	if i % 2 == 0:
		print(l)


(rows, cols) = [int(x) for x in input().split()]
for i in range(1, rows + 1):
	if i % 4 == 0:
		print('#', end='')
		print('.' * (cols - 1))
	elif i % 2 == 0:
		print('.' * (cols - 1), end='')
		print('#')
	else:
		print('#' * cols)


(n, m) = map(int, input().split())
ans = [['.' for i in range(m)] for j in range(n)]
for i in range(0, n, 2):
	for j in range(m):
		ans[i][j] = '#'
flg = True
for i in range(1, n, 2):
	if flg:
		ans[i][-1] = '#'
	else:
		ans[i][0] = '#'
	flg = not flg
for i in range(n):
	print(''.join(ans[i]))


(n, m) = [int(x) for x in input().split()]
z = m - 1
c = 1
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif c % 2 == 1:
		print('.' * z, end='')
		print('#')
		c = c + 1
	else:
		print('#', end='')
		print('.' * z)
		c = c + 1


def cf_510():
	(n, m) = map(int, input().split())
	arr = []
	r = True
	for i in range(n):
		if i % 2 == 0:
			arr.append(['#' * m])
		else:
			if r:
				arr.append(['.' * (m - 1) + '#'])
			else:
				arr.append(['#' + '.' * (m - 1)])
			r = not r
	for i in arr:
		print(i[0])
cf_510()


class TaskA(object):

	def __init__(self):
		self.get_data()
		self.solve()
		self.print_ans()
	pass

	def get_data(self):
		(self.n, self.m) = map(int, input().split())
		pass

	def solve(self):
		self.ans = list()
		for i in range(self.n):
			ch = '#'
			if i & 1:
				ch = '.'
			for j in range(self.m):
				self.ans.append(ch)
		for i in range(1, self.n, 4):
			index = i * self.m + (self.m - 1)
			self.ans[index] = '#'
		for i in range(3, self.n, 4):
			index = i * self.m + 0
			self.ans[index] = '#'
		pass

	def print_ans(self):
		for i in range(self.n):
			for j in range(self.m):
				index = i * self.m + j
				print(self.ans[index], end='')
			print()
		pass

def main():
	TaskA()
	pass
main()


b = list(map(int, input().split()))
(rows, cols) = (b[0], b[1])
my_array = [[0 for i in range(cols)] for j in range(rows)]
for i in range(b[0]):
	if i % 2 == 0:
		for j in range(b[1]):
			my_array[i][j] = '#'
	if i % 2 != 0:
		if (i - 1) % 4 == 0:
			for j in range(b[1] - 1):
				my_array[i][j] = '.'
			my_array[i][b[1] - 1] = '#'
	if i % 2 != 0:
		if (i - 1) % 4 != 0:
			for j in range(1, b[1]):
				my_array[i][j] = '.'
			my_array[i][0] = '#'
for r in my_array:
	a = ''.join((c for c in r))
	print(a, end=' ')
	print()


import math
(n, m) = map(int, input().split())
last = 1
for i in range(n):
	if i % 2 == 0:
		print(m * '#')
	elif last == 1:
		print((m - 1) * '.', '#', sep='')
		last = 0
	else:
		print('#', (m - 1) * '.', sep='')
		last = 1


imp = input().split(' ')
imp = [int(imp[i]) for i in range(2)]
m = imp[1]
n = imp[0]
p = '#'
q = '.'
count = 0
print(m * p)
for each in range(int((n - 1) / 2)):
	if count % 2 == 0:
		print((m - 1) * q + p)
	else:
		print(p + (m - 1) * q)
	print(m * p)
	count += 1


(n, m) = input().strip().split()
(n, m) = [int(n), int(m)]
for i in range(n):
	j = i + 1
	a = ''
	if j % 2 != 0:
		for q in range(m):
			a = a + '#'
		print(a)
	elif j % 2 == 0 and j % 4 != 0:
		a = ''
		for r in range(m - 1):
			a = a + '.'
		a = a + '#'
		print(a)
	elif j % 2 == 0 and j % 4 == 0:
		a = '#'
		for w in range(m - 1):
			a = a + '.'
		print(a)


(n, m) = map(int, input().split())
i = 0
a = ''
while i < n:
	if i % 2 == 0:
		print('#' * m)
	elif i % 2 == 1:
		if a == '.' * (m - 1) + '#':
			print('#' + '.' * (m - 1))
			a = '#' + '.' * (m - 1)
		else:
			print('.' * (m - 1) + '#')
			a = '.' * (m - 1) + '#'
	i += 1


(n, m) = input().split()
(n, m) = (int(n), int(m))
x = '#' * m
y = '.' * (m - 1) + '#'
f = True
for i in range(n):
	if i % 2:
		if f:
			f = False
			print(y)
		else:
			f = True
			print(y[::-1])
	else:
		print(x)


s = input().split()
(c, r) = (int(s[0]), int(s[1]))
s = '#' * r
k = '.' * (r - 1)
for i in range(1, c + 1):
	if i % 2 == 1:
		print(s)
	elif i % 4 == 0:
		print('#' + k)
	else:
		print(k + '#')


(n, m) = map(int, input().split())
c = 1
for i in range(1, n + 1):
	if i % 2 == 0:
		if c % 2 != 0:
			for i in range(m - 1):
				print('.', end='')
			print('#')
			c += 1
		else:
			print('#', end='')
			for i in range(m - 1):
				print('.', end='')
			print()
			c += 1
	else:
		for i in range(m):
			print('#', end='')
		print()


nums = [int(s) for s in input().split()]
n = nums[0]
m = nums[1]
count = 0
while count < n:
	print('#' * m)
	count += 1
	if count < n and (count + 1) % 4 == 0:
		print('#' + '.' * (m - 1))
		count += 1
	elif count < n and (count + 1) % 4 != 0:
		print('.' * (m - 1) + '#')
		count += 1


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	s = ''
	if i % 4 == 1 or i % 4 == 3:
		for j in range(m):
			s += '#'
		print(s)
	elif i % 4 == 2 or i % 4 == 0:
		for j in range(m - 1):
			s += '.'
		if i % 4 == 2:
			print(s + '#')
		else:
			print('#' + s)


(a, b) = map(int, input().strip().split())
count = 0
for i in range(1, a + 1):
	if i % 2 != 0:
		print('#' * b)
	else:
		count += 1
		if count % 2 != 0:
			print('.' * (b - 1), end='')
			print('#')
		else:
			print('#', end='')
			print('.' * (b - 1))


(a, b) = list(map(int, input().split()))
y = 1
for i in range(1, a + 1):
	if i % 2 != 0:
		print('#' * b)
	if i % 2 == 0 and y % 2 != 0:
		print('.' * (b - 1) + '#')
		y += 1
	elif i % 2 == 0 and y % 2 == 0:
		print('#' + '.' * (b - 1))
		y += 1


(n, m) = map(int, input().split())
snake = [['#' for x in range(m)] for y in range(n)]
if n > 1:
	for i in range(1, n, 4):
		for j in range(m - 1):
			snake[i][j] = '.'
if n >= 5:
	for i in range(3, n, 4):
		for j in range(1, m):
			snake[i][j] = '.'

def prn(T):
	for r in T:
		for c in r:
			print(c, end='')
		print()
prn(snake)


(n, m) = map(int, input().split(' '))
lst = [['#' for _ in range(m)] for _ in range(n)]
l = 0
for i in range(n):
	if i % 2 != 0:
		if l == 0:
			for j in range(m - 1):
				lst[i][j] = '.'
			l = 1
		else:
			for j in range(1, m):
				lst[i][j] = '.'
			l = 0
for i in range(n):
	print(''.join(lst[i]))


p = list(map(int, input().split()))
c = p[0]
c1 = p[1]
s = ''
s1 = ''
for j in range(c1):
	s = s + '#'
for j in range(c1 - 1):
	s1 = s1 + '.'
for i in range(c):
	if i % 2 == 0:
		print(s)
	elif i % 4 == 1:
		print(s1, end='')
		print('#')
	else:
		print('#', end='')
		print(s1)


(r, c) = map(int, input().split())
co = 0
for i in range(r):
	co += 1
	for j in range(c):
		if co % 2 == 0 and co % 4 != 0:
			if j == c - 1:
				print('#', end='')
			else:
				print('.', end='')
		elif co % 4 == 0:
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
		else:
			print('#', end='')
	print()


def gg(ch, len):
	return ''.join(list((ch for i in range(len))))
(n, m) = map(int, input().split())
for i in range(n):
	if i % 2 == 0:
		print(gg('#', m))
	elif i % 4 == 1:
		print(gg('.', m - 1) + '#')
	else:
		print('#' + gg('.', m - 1))


(yy, x) = map(int, input().split())
b = True
for y in range(yy):
	if y & 1:
		if b:
			print('.' * (x - 1) + '#')
		else:
			print('#' + '.' * (x - 1))
		b = not b
	else:
		print('#' * x)


inp = str(input())
ip = inp.split()
b = int(ip[0])
c = int(ip[1])
for i in range(1, b + 1):
	if i % 2 != 0:
		for x in range(1, c + 1):
			print('#', end='')
		print()
	elif i % 4 == 0:
		print('#', end='')
		for p in range(1, c):
			print('.', end='')
		print()
	elif i % 2 == 0:
		for p in range(1, c):
			print('.', end='')
		print('#')


(n, m) = [int(x) for x in input().split(' ')]
A = ['#' for _ in range(m)]
B = ['.' for _ in range(m)]
grid = []
k = 0
for i in range(n):
	if i % 2 == 0:
		grid.append(''.join(A))
	else:
		b = list.copy(B)
		if k % 2 == 0:
			b[-1] = '#'
		else:
			b[0] = '#'
		k += 1
		grid.append(''.join(b))
for row in grid:
	print(row)


s = input().split()
n = int(s[0])
m = int(s[1])
b = False
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		s = '.' * (m - 1)
		print('#' + s if b else s + '#')
		b = not b


(n, m) = input().strip().split(' ')
(n, m) = (int(n), int(m))
for i in range(0, n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	elif i % 4 == 3:
		print('#' + '.' * (m - 1))


(n, m) = [int(x) for x in input().split()]
t = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif t == 0:
		print('.' * (m - 1) + '#')
		t = 1
	else:
		print('#' + '.' * (m - 1))
		t = 0


(row, col) = map(int, input().split())
flag = True
for i in range(0, row):
	if i % 2 == 0:
		print('#' * col)
	elif i % 2 != 0 and flag == True:
		print('.' * (col - 1) + '#')
		flag = False
	elif i % 2 != 0 and flag == False:
		print('#' + '.' * (col - 1))
		flag = True


(r, c) = map(int, input().split())
count = 0
for i in range(1, r + 1):
	if i % 2 != 0:
		print('#' * c)
	elif count == 0:
		print('.' * (c - 1), '#', sep='')
		count += 1
	else:
		print('#', '.' * (c - 1), sep='')
		count = 0


(n, m) = list(map(int, input().split()))
for i in range(m):
	print('#', end='')
print()
n = n - 1
q = 1
while n != 0:
	if q % 2 != 0:
		for i in range(m - 1):
			print('.', end='')
		print('#', end=' ')
		print()
		for i in range(m):
			print('#', end='')
		print()
	else:
		print('#', end='')
		for i in range(m - 1):
			print('.', end='')
		print()
		for i in range(m):
			print('#', end='')
		print()
	n = n - 2
	q = q + 1


from sys import stdin, stdout
from math import ceil, floor, sqrt
from collections import deque, Counter
inp = stdin.readline
out = stdout.write
(n, m) = map(int, inp().strip().split())
f = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if f == 0:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		f = not f


n = list(map(int, input().split()))
r = n[0]
c = n[1]
i = 0
lastcol = 1
count = 0
while count < r * c:
	if i % 2 == 0:
		for k in range(c):
			print('#', end='')
		count = count + c
		print()
	elif i % 2 != 0:
		if lastcol == 1:
			for k in range(c - 1):
				print('.', end='')
			print('#')
			lastcol = 0
			count = count + c
		elif lastcol == 0:
			lastcol = 1
			print('#', end='')
			for k in range(1, c):
				print('.', end='')
			print()
			count = count + c
	i = i + 1


(n, m) = map(int, input().split())
a = []
o = 0
for i in range(n):
	l = []
	for j in range(m):
		if i % 2 == 0:
			l.append('#')
		else:
			l.append('.')
	if o % 2 == 0 and i % 2 != 0:
		l.pop()
		l.append('#')
		o += 1
	elif o % 2 != 0 and i % 2 != 0:
		l.remove('.')
		l.insert(0, '#')
		o += 1
	a.append(l)
for i in a:
	for j in i:
		print(j, end='')
	print()


(rows, columns) = map(int, input().split())
flag = True
for i in range(rows):
	if i % 2 != 0 and flag == True:
		for j in range(columns - 1):
			print('.', end='')
		print('#')
		flag = False
	elif i % 2 != 0 and flag == False:
		print('#', end='')
		for j in range(columns - 1):
			print('.', end='')
		flag = True
		print('')
	else:
		for j in range(columns):
			print('#', end='')
		print('')


(a, b) = map(int, input().split())
flag = True
for i in range(a):
	if i % 2 == 0:
		print(b * '#')
	elif flag:
		print((b - 1) * '.' + '#')
		flag = False
	else:
		print('#' + (b - 1) * '.')
		flag = True


def print_mat(mat, n, m):
	for i in range(n):
		st = ''
		for j in range(m):
			st += mat[i][j]
		print(st)
(n, m) = map(int, input().split())
mat = [['.' for i in range(m)] for j in range(n)]
alt = 0
for i in range(n):
	for j in range(m):
		if (i + 1) % 2 == 1:
			mat[i][j] = '#'
		elif alt == 0:
			mat[i][m - 1] = '#'
			alt = 1
			break
		else:
			mat[i][0] = '#'
			alt = 0
			break
print_mat(mat, n, m)


(a, b) = map(int, input().split())
for i in range(a):
	if i % 2 == 0:
		for j in range(b):
			print('#', end='')
		print(end='\n')
	else:
		if (i - 3) % 4 == 0:
			print('#', end='')
		for j in range(b - 1):
			print('.', end='')
			if j == b - 2 and (i - 3) % 4 == 0:
				print(end='\n')
		if (i - 1) % 4 == 0:
			print('#')


(row, col) = [int(a) for a in input().strip().split()]
right = True
for i in range(1, row + 1):
	if i % 2 == 1:
		print('#' * col)
	elif right:
		print('.' * (col - 1) + '#')
		right = False
	else:
		print('#' + '.' * (col - 1))
		right = True


(n, m) = (int(i) for i in input().split())
r = -3
l = 3
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 2 == 1 and i == r + 4:
		print('.' * (m - 1) + '#')
		r += 4
	else:
		print('#' + '.' * (m - 1))


s = input().split()
a = int(s[0])
b = int(s[1])
i1 = 1
j1 = 1
for i in range(1, a + 1):
	if i % 2 != 0:
		S = ['#' for j in range(b)]
	if i % 2 == 0:
		S = ['.' for j in range(b)]
		if j1 % 2 == 0:
			S[0] = '#'
		if j1 % 2 != 0:
			S[b - 1] = '#'
		j1 = j1 + 1
	print(''.join(S))


(n, m) = [int(x) for x in input().split()]
pattern = ('#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1))
for i in range(n):
	print(pattern[i % 4])


(row, column) = list(map(int, input().split()))
odd = ['#' for i in range(column)]
even1 = ['.' for i in range(column - 1)]
even1 += '#'
even2 = ['.' for i in range(column - 1)]
even2.insert(0, '#')
res = []
check = False
for i in range(1, row + 1):
	if i % 2 == 1:
		res.append(odd)
	elif i % 2 == 0 and check == False:
		check = True
		res.append(even1)
	else:
		res.append(even2)
		check = False
for i in res:
	for j in i:
		print(j, end='')
	print()


(n, b) = map(int, input().split())
k = 1
for i in range(1, n + 1):
	if i % 2 == 0:
		if k == 1:
			print('.' * (b - 1), '#', sep='')
		else:
			print('#', '.' * (b - 1), sep='')
		k = -k
	else:
		print('#' * b)


(n, m) = map(int, input().split())
ct = 0
for i in range(1, n + 1):
	if i % 2 == 0:
		if ct == 0:
			print('{}{}'.format('.' * (m - 1), '#'))
			ct = 1
		else:
			print('{}{}'.format('#', '.' * (m - 1)))
			ct = 0
	else:
		print('{}'.format('#' * m))


dim = list(map(int, input().split()))
for i in range(1, dim[0] + 1):
	st = ''
	if i % 2 != 0:
		for j in range(dim[1]):
			st += '#'
		print(st)
	else:
		if i % 2 == 0:
			if i % 4 == 0:
				st += '#'
				for k in range(dim[1] - 1):
					st += '.'
			else:
				for l in range(dim[1] - 1):
					st += '.'
				st += '#'
		print(st)


(n, m) = map(int, input().split())
reverse = False
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif reverse == False:
		print('.' * (m - 1), '#', sep='')
		reverse = True
	else:
		print('#', '.' * (m - 1), sep='')
		reverse = False


(x, y) = input().split()
(x, y) = (int(x), int(y))
k = 1
for i in range(x):
	for j in range(y):
		if i % 2 == 0:
			print('#', end='')
		elif i % 2 == 1:
			if j == y - 1 and k % 2 == 1:
				print('#', end='')
			elif j == 0 and k % 2 == 0:
				print('#', end='')
			else:
				print('.', end='')
	if i % 2 == 1:
		k = k + 1
		print()
	else:
		print()


(n, m) = map(int, input().split())
swap = False
for rnd in range(n):
	if rnd % 2 == 0:
		print('#' * m)
	else:
		if not swap:
			print('.' * (m - 1), end='')
			print('#')
		else:
			print('#', end='')
			print('.' * (m - 1))
		swap = not swap


(n, m) = map(int, input().split())
hash_string = '#' * m
right_hash_string = '.' * (m - 1) + '#'
left_hash_string = '#' + '.' * (m - 1)
check = 1
for i in range(1, n + 1):
	if i % 2 == 0:
		if check:
			print(right_hash_string)
			check = 0
		else:
			print(left_hash_string)
			check = 1
	else:
		print(hash_string)


import sys
import math
z = list(input().split())
a = int(z[0])
b = int(z[1])
x = 1
v = b - 1
for i in range(a // 2):
	if x:
		print('#' * b)
		print('.' * v, end='')
		print('#')
		x = 0
		if i == a // 2 - 1:
			print('#' * b)
	else:
		print('#' * b)
		print('#', end='')
		print('.' * v)
		x = 1
		if i == a // 2 - 1:
			print('#' * b)


(n, p) = map(int, input().split())
for i in range(n):
	if i % 2 == 0:
		print('#' * p)
	elif i % 4 == 1:
		print('.' * (p - 1) + '#')
	else:
		print('#' + '.' * (p - 1))


(n, m) = map(int, input().split())
k = 0
l = m
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			if j == l - 1:
				k += 1
				print('#')
				continue
			print('#', end='')
		else:
			if k % 2 != 0 and j == l - 1:
				print('#')
				continue
			elif k % 2 == 0 and j == 0:
				print('#', end='')
				continue
			if j == l - 1:
				print('.')
				continue
			print('.', end='')


(n, m) = map(int, input().split())
for i in range(n):
	if not i & 1:
		for _ in range(m):
			print('#', end='')
	elif (i + 1) % 4 == 0:
		print('#', end='')
		for _ in range(1, m):
			print('.', end='')
	else:
		for _ in range(m - 1):
			print('.', end='')
		print('#', end='')
	print()


TN = 1

def solution():
	(n, m) = map(int, input().split())
	ans = [['.' for j in range(m)] for i in range(n)]
	for i in range(0, n + 1, 2):
		ans[i] = ['#'] * m
	cur = -1
	for i in range(1, n, 2):
		ans[i][cur] = '#'
		if cur == 0:
			cur = -1
		else:
			cur = 0
	for i in ans:
		print(''.join(i))
while TN != 0:
	solution()
	TN -= 1


(n, m) = [int(j) for j in input().split()]
a = '#' * m
b = '.' * (m - 1) + '#'
c = '#' + '.' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		print(a)
	elif i % 4 == 1:
		print(b)
	else:
		print(c)


[n, m] = [int(x) for x in input().split()]
for i in range(n):
	if i % 4 == 1:
		print((m - 1) * '.' + '#')
	elif i % 4 == 3:
		print('#' + (m - 1) * '.')
	else:
		print(m * '#')


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 != 0:
		for i in range(m):
			print('#', end='')
		print()
	elif i % 4 == 0:
		print('#', end='')
		for i in range(m - 1):
			print('.', end='')
		print()
	elif i % 2 == 0:
		for i in range(m - 1):
			print('.', end='')
		print('#')


import math
(a, b) = map(int, input().split())
for i in range(1, a + 1):
	if i % 2 != 0:
		print('#' * b)
	elif i / 2 % 2 != 0:
		print('.' * (b - 1) + '#')
	else:
		print('#' + '.' * (b - 1))


n = list(map(int, input().split()))
y = n[0]
x = n[1]
for i in range(1, y + 1):
	if i % 4 == 0:
		print('#' + '.' * (x - 1))
	elif i % 2 == 0:
		print('.' * (x - 1) + '#')
	else:
		print('#' * x)


answer = ''
(n, m) = map(int, input().split())
c = 1
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 != 0:
			answer += '#' * m
			break
		elif c == 1:
			answer += '.' * (m - 1) + '#'
			c = -1
			break
		elif c == -1:
			answer += '#' + '.' * (m - 1)
			c = 1
			break
	answer += '\n'
print(answer)


def fun():
	(a, b) = map(int, input().split())
	s = ''
	for i in range(b):
		s += '#'
	s1 = ''
	s2 = '#'
	for i in range(b - 1):
		s1 += '.'
		s2 += '.'
	s1 += '#'
	flag = True
	cnt = 0
	while cnt < a:
		cnt += 1
		if cnt % 2 != 0:
			print(s)
		elif flag:
			print(s1)
			flag = False
		else:
			print(s2)
			flag = True
fun()


[a, b] = [int(i) for i in input().split()]
w1 = b * '#'
w2 = (b - 1) * '.' + '#'
w3 = '#' + (b - 1) * '.'
print(w1)
i = -1
for i in range((a - 1) // 4):
	print(w2)
	print(w1)
	print(w3)
	print(w1)
c = a - 4 * (i + 1) - 1
if c == 0:
	quit()
elif c == 2:
	print(w2)
	print(w1)


(n, m) = map(int, input().split())
b = '#' * m
r = '.' * (m - 1) + '#'
l = '#' + '.' * (m - 1)
sw = 0
for i in range(n):
	if i % 2 == 0:
		print(b)
	elif not sw:
		print(r)
		sw = 1
	else:
		print(l)
		sw = 0


(n, m) = map(int, input().split())
q = '#' * m
w = '.' * (m - 1) + '#'
e = w[::-1]
for i in range(1, n + 1):
	if i % 4 == 0:
		t = e
	elif i % 2 == 0:
		t = w
	else:
		t = q
	print(t)


(n, m) = [int(i) for i in input().split()]
c = 0
lines = []
for _ in range(n):
	lines.append('#' * m)
	if c % 2 == 0:
		lines.append(f"{'.' * (m - 1)}#")
	else:
		lines.append(f"#{'.' * (m - 1)}")
	c += 1
for line in lines[:n]:
	print(line)


(a, b) = map(int, input().split(' '))
c = '#'
d = ''
e = '.'
f = '#'
g = ''
for x in range(1, a + 1):
	if x % 2 == 0 and x % 4 != 0:
		d = (b - 1) * e + c
		print(d)
	elif x % 2 != 0:
		d = b * f
		print(d)
	if x % 4 == 0:
		d = c + (b - 1) * e
		print(d)


a = list(map(int, input().split()))
n = a[0]
m = a[1]
for i in range(1, n + 1):
	if i % 4 == 1:
		print('#' * m)
	elif i % 4 == 3:
		print('#' * m)
	elif i % 4 == 2:
		print('.' * (m - 1) + '#')
	elif i % 4 == 0:
		print('#' + '.' * (m - 1))


(rows, cols) = [int(i) for i in input().split()]
for r in range(0, rows):
	if r % 4 == 1:
		print('.' * (cols - 1) + '#')
	elif r % 4 == 3:
		print('#' + '.' * (cols - 1))
	else:
		print('#' * cols)


(x, y) = input().split()
x = int(x)
y = int(y)
for i in range(1, x + 1):
	if i % 2 == 1:
		print('#' * int(y))
	else:
		d = i // 2
		if d % 2 == 1:
			print('.' * (int(y) - 1) + '#')
		else:
			print('#' + '.' * (int(y) - 1))


x = input().split(' ')
row = int(x[1])
col = int(x[0])
solution = []
for x in range(col):
	solution.append([' '] * row)
start = False
for i in range(col):
	if i % 2 == 0:
		solution[i] = ['#'] * row
	elif not start:
		solution[i] = ['.'] * row
		solution[i][-1] = '#'
		start = True
	else:
		solution[i] = ['.'] * row
		solution[i][0] = '#'
		start = False
for x in solution:
	out = ''
	for y in x:
		out += y
	print(out)


(n, m) = map(int, input().split())
for j in range(n):
	print(['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)][j % 4])


def printBoard(res):
	for i in range(0, len(res)):
		print(''.join(res[i]))
(n, m) = [int(x) for x in input().strip().split()]
res = [['.'] * m for i in range(0, n)]
for i in range(0, n, 2):
	for j in range(0, m):
		res[i][j] = '#'
	if i + 1 < n:
		if (i + 1) % 4 == 1:
			res[i + 1][m - 1] = '#'
		elif (i + 1) % 4 == 3:
			res[i + 1][0] = '#'
printBoard(res)


x = [int(j) for j in input().split()]
row = x[0]
col = x[1]
for i in range(row):
	for j in range(col):
		if (i + 1) % 4 == 0 and i != 0 and (j == 0):
			print('#', end='')
		elif (i + 1) % 4 == 0 and i != 0 and (j != 0):
			print('.', end='')
		elif i % 2 != 0 and j < col - 1:
			print('.', end='')
		elif i % 2 == 0:
			print('#', end='')
		else:
			print('#', end='')
	print()


(n, m) = map(int, input().split())
flag = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif flag == 0:
		print('.' * (m - 1) + '#')
		flag = 1
	else:
		print('#' + '.' * (m - 1))
		flag = 0


(n, m) = list(map(int, input().split()))
p1 = '#' * m + '\n' + '.' * (m - 1) + '#'
p2 = '#' * m + '\n' + '#' + '.' * (m - 1)
n = n // 2
ans = ''
i = 1
while i <= n:
	if len(ans) > 0:
		ans = ans + '\n'
	if i % 2 != 0:
		ans = ans + p1
	else:
		ans = ans + p2
	i = i + 1
ans = ans + '\n' + '#' * m
print(ans)


(r, c) = map(int, input().split())
i = 1
k = 0
while i <= r:
	if i % 2 == 1:
		print('#' * c)
	elif k == 0:
		print('.' * (c - 1) + '#')
		k = 1
	else:
		print('#' + '.' * (c - 1))
		k = 0
	i += 1


(a, b) = map(int, input().split())
l = True
for i in range(1, a + 1):
	if i % 2 == 1:
		print('#' * b)
	else:
		if l == True:
			print('.' * (b - 1) + '#')
			l = False
			continue
		if l == False:
			print('#' + '.' * (b - 1))
			l = True
			continue


(n, m) = map(int, input().split(' '))
r = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if r:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		r ^= True


(n, m) = input().split(' ')
n = int(n)
m = int(m)
sznejk = []
right = True
for i in range(n + 1):
	if i > 0:
		if i % 2 == 0:
			poz = '.' * (m - 1)
			poz_list = [a for a in poz]
			if right:
				poz_list.append('#')
				right = False
			else:
				poz_list.insert(0, '#')
				right = True
			sznejk.append(''.join(poz_list))
		else:
			sznejk.append('#' * m)
for x in sznejk:
	print(x)


(m, n) = [int(i) for i in input().split()]
c = 1
k = 0
i = 1
j = 1
for i in range(1, m + 1):
	output = ''
	for j in range(1, n + 1):
		if i % 2 == 1:
			output += '#'
		elif i % 2 != 1:
			k = i / 2
			if k % 2 == 1:
				if j < n:
					output += '.'
				else:
					output += '#'
					k = 0
			elif k % 2 != 1:
				if j == 1:
					output += '#'
				else:
					output += '.'
					k = 1
	print(output)


d = input().split()
length = int(d[0])
width = int(d[1])
x = ''
for i in range(length):
	if i % 2 == 0:
		x += '#' * width + '\n'
	elif i // 2 % 2 == 0:
		x += '.' * (width - 1) + '#' + '\n'
	else:
		x += '#' + '.' * (width - 1) + '\n'
print(x[:-1])


(y, x) = map(int, input().split())
left = False
for _ in range(y):
	if _ % 2 == 0:
		for __ in range(x):
			print('#', end='')
	elif left:
		print('#', end='')
		for __ in range(x - 1):
			print('.', end='')
		left = not left
	else:
		for __ in range(x - 1):
			print('.', end='')
		print('#', end='')
		left = not left
	print()


def foxAndSnake():
	values = input().split()
	m = int(values[0])
	n = int(values[1])
	for i in range(1, m + 1):
		if i % 2 == 0:
			if i % 4 == 0:
				print('#' + '.' * (n - 1))
			else:
				print('.' * (n - 1) + '#')
		else:
			print('#' * n)
foxAndSnake()


(c, l) = map(int, input().split())
for a in range(c):
	d = a % 4
	if d == 1:
		print('.' * (l - 1) + '#')
	elif d == 3:
		print('#' + '.' * (l - 1))
	else:
		print('#' * l)


(a, b) = list(map(int, input().split()))
count = 0
for i in range(0, a):
	if i % 2 == 0:
		for i in range(0, b):
			print('#', end='')
		print('\n', end='')
	elif i % 2 != 0:
		if count % 2 == 0:
			for i in range(1, b):
				print('.', end='')
			print('#', end='')
			print('\n', end='')
			count = count + 1
		elif count % 2 != 0:
			print('#', end='')
			for i in range(1, b):
				print('.', end='')
			print('\n', end='')
			count = count + 1


(r, c) = [int(x) for x in input().split()]
l = ['.' * c for i in range(r)]
for i in range(r):
	if i % 2 == 0:
		l[i] = '#' * c
	elif (i - 1) // 2 % 2 == 0:
		lst = list(l[i])
		lst[c - 1] = '#'
		l[i] = ''.join(lst)
	else:
		lst = list(l[i])
		lst[0] = '#'
		l[i] = ''.join(lst)
for i in l:
	print(i)


(h, w) = map(int, input().split())
for cH in range(1, h + 1):
	cS = str()
	for cW in range(1, w + 1):
		if cH % 4 == 0:
			if cW == 1:
				cS += '#'
			else:
				cS += '.'
		elif cH % 2 == 0:
			if cW == w:
				cS += '#'
			else:
				cS += '.'
		else:
			cS += '#'
	print(cS)


(n, m) = [int(t) for t in input().split()]
for i in range(n):
	if i % 2 == 0:
		t = m * ['#']
	elif (i + 1) % 4 != 0:
		t = (m - 1) * ['.']
		t.append('#')
	else:
		t = (m - 1) * ['.']
		t.insert(0, '#')
	print(''.join(t))


(rows, cols) = [int(x) for x in input().split(' ')]
start = False
for i in range(rows):
	if (i + 1) % 2 != 0:
		[print('#', end='') for _ in range(cols)]
		print()
	elif start:
		print('#', end='')
		[print('.', end='') for _ in range(1, cols)]
		print()
		start = False
	else:
		[print('.', end='') for _ in range(1, cols)]
		print('#')
		start = True


(n, m) = map(int, input().split())
go = 1
for a in range(n):
	if a % 2 == 0:
		print('#' * m)
	elif a % 2 == 1:
		if go == 1:
			print('.' * (m - 1) + '#')
			go = 0
		else:
			print('#' + '.' * (m - 1))
			go = 1


l = lambda : map(int, input().split())
(n, m) = l()
t = True
for i in range(n):
	if i % 2 == 0:
		print(m * '#')
	elif t:
		print((m - 1) * '.' + '#')
		t = False
	else:
		print('#' + (m - 1) * '.')
		t = True


(row, col) = map(int, input().split())
for i in range(row):
	if i % 2 == 0:
		print('#' * col)
	elif i % 4 == 1:
		print('.' * (col - 1) + '#')
	else:
		print('#' + '.' * (col - 1))


(n, m) = map(int, input().split())
l = [[None for i in range(m)] for j in range(n)]
flg = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			l[i][j] = '#'
	elif flg == 0:
		for j in range(m - 1):
			l[i][j] = '.'
		l[i][m - 1] = '#'
		flg = 1
	else:
		l[i][0] = '#'
		for j in range(1, m):
			l[i][j] = '.'
		flg = 0
ll = []
for i in l:
	ll.append(''.join(i))
for i in ll:
	print(i)


import sys
from random import choice, randint
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	(n, m) = MI()
	c = 0
	for i in range(n):
		if i % 2 == 0:
			pf('#' * m)
		else:
			if c % 2 == 0:
				pf('.' * (m - 1) + '#')
			else:
				pf('#' + '.' * (m - 1))
			c += 1
main()


(a, b) = map(int, input().split())
moving = True
x = False
for i in range(a):
	if moving:
		print('#' * b)
	else:
		if not x:
			print('.' * (b - 1) + '#')
		else:
			print('#' + (b - 1) * '.')
		x = not x
	moving = not moving


(n, m) = map(int, input().split())
data = [['#' for _ in range(m)] for _ in range(n)]
for i in range(1, n, 2):
	data[i] = ['.' for _ in range(m)]
	if (i + 1) // 2 % 2 == 0:
		data[i][0] = '#'
	else:
		data[i][-1] = '#'
for i in range(n):
	for j in range(m):
		print(data[i][j], end='')
	print()


(n, m) = input().split()
n = int(n)
m = int(m)
flag = True
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	else:
		if flag == True:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		flag = not flag


dim = list(map(int, input().split()))
for count in range(1, dim[0] + 1):
	if count % 2 == 1:
		[print('#', end='') for x in range(dim[1] - 1)]
		print('#')
	elif count % 4 == 0:
		print('#', end='')
		[print('.', end='') for x in range(dim[1] - 2)]
		print('.')
	else:
		[print('.', end='') for x in range(dim[1] - 1)]
		print('#')


(m, n) = map(int, input().split())
t = '#'
t = t * n
y = '.'
y = y * (n - 1)
for i in range(1, m + 1):
	if i % 2 != 0:
		print(t)
	else:
		temp = ''
		if i % 4 == 0:
			temp = '#' + y
		else:
			temp = y + '#'
		print(temp)


(x, y) = map(int, input().split())
s1 = y * '#'
s2 = (y - 1) * '.' + '#'
i = 0
while i < x:
	if i % 2 == 0:
		print(s1)
	if i % 2 == 1:
		print(s2)
		s2 = list(s2)
		s2.reverse()
		s2 = ''.join(s2)
	i = i + 1


(r, c) = [int(n) for n in input().split()]
r //= 2
p = 0
while r > 0:
	print('#' * c)
	if p % 2 == 0:
		print('.' * (c - 1) + '#')
	else:
		print('#' + '.' * (c - 1))
	r -= 1
	p += 1
print('#' * c)


(m, n) = [int(x) for x in input().split()]
for i in range(m):
	row = i + 1
	if row % 2 == 1:
		for j in range(n):
			print('#', end='')
	elif row % 4 == 2:
		for j in range(n - 1):
			print('.', end='')
		print('#', end='')
	else:
		print('#', end='')
		for j in range(n - 1):
			print('.', end='')
	print()


(n, m) = list(map(int, input().split()))
fromLeft = False
j = 0
while j < n:
	if j % 2 == 0:
		k = 0
		while k < m:
			if k != m - 1:
				print('#', end='')
				k += 1
			else:
				print('#')
				k += 1
				j += 1
	elif fromLeft == False:
		k = 0
		while k < m:
			if k != m - 1:
				print('.', end='')
				k += 1
			else:
				fromLeft = True
				print('#')
				k += 1
				j += 1
	else:
		k = 0
		while k < m:
			if k == 0:
				print('#', end='')
				k += 1
			elif k != m - 1:
				print('.', end='')
				k += 1
			else:
				print('.')
				fromLeft = False
				k += 1
				j += 1


(n, m) = map(int, input().split())
a = '#' * m
b = '#' + '.' * (m - 1)
c = b[len(b)::-1]
right = 4
for i in range(1, n + 1):
	if i % 2 == 0:
		if i == right:
			print(b)
			right += 4
		else:
			print(c)
	else:
		print(a)


(n, m) = [int(i) for i in input().split()]
(a, b) = ('.' * (m - 1), '#')
for i in range(n):
	print((a + '#' if i % 4 < 2 else '#' + a) if i % 2 else '#' * m)


(n, m) = [int(x) for x in input().split(' ')]
alt = True
right = True
for i in range(n):
	if alt:
		print('#' * m)
		alt = False
	else:
		if right:
			print('.' * (m - 1) + '#')
			right = False
		else:
			print('#' + '.' * (m - 1))
			right = True
		alt = True


(n, m) = map(int, input().split())
count = 3
r = 3
for i in range(n):
	if count % 2 != 0:
		print('#' * m)
	else:
		if r % 2 == 0:
			print('#', '.' * (m - 1), sep='')
		else:
			print('.' * (m - 1), '#', sep='')
		r += 1
	count += 1


(n, m) = [int(x) for x in input().split()]
r = 0
for i in range(n):
	if (i + 1) % 2 != 0:
		for j in range(m):
			print('#', end='')
		print()
	elif r == 0:
		for j in range(m - 1):
			print('.', end='')
		print('#', end='')
		print()
		r = 1
	else:
		print('#', end='')
		for j in range(m - 1):
			print('.', end='')
		print()
		r = 0


(n, m) = map(int, input().split())
res = []
left = True
for i in range(n):
	snake = ''
	if i % int(2) == int(0):
		for j in range(m):
			snake += '#'
	else:
		if not left:
			snake += '#'
		for j in range(m - int(1)):
			snake += '.'
		if left:
			snake += '#'
		left = not left
	res.append(snake)
print(*res, sep='\n')


(n, m) = [int(i) for i in input().split()]
a = []
b = ''
c = 0
for i in range(n):
	b = ['.' for j in range(m)]
	a.append(b)
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			a[i][j] = '#'
		elif c % 2 == 0:
			a[i][-1] = '#'
			c += 1
			break
		else:
			a[i][0] = '#'
			c += 1
			break
for i in a:
	print(*i, sep='')


(y, x) = [int(i) for i in input().split(' ')]
isOnLeftSide = False
for i in range(y):
	if i % 2 == 0:
		print('#' * x)
	else:
		dots = '.' * (x - 1)
		if isOnLeftSide:
			print('#' + dots)
		else:
			print(dots + '#')
		isOnLeftSide = not isOnLeftSide


(n, m) = map(int, input().split())
pattern_A = '#' * m
pattern_B = '#' + '.' * (m - 1)
pattern_C = pattern_B[::-1]
flag = True
for i in range(n):
	if i % 2 == 0:
		print(pattern_A)
	else:
		if flag:
			print(pattern_C)
		else:
			print(pattern_B)
		flag = not flag


(a, b) = map(int, input().split())
for i in range(a):
	print(['#' * b, '.' * (b - 1) + '#', '#' * b, '#' + '.' * (b - 1)][i % 4])


(n, m) = map(int, input().split())
t = False
for i in range(n):
	if (i + 1) % 2:
		print('#' * m)
	else:
		if t:
			print('#' + '.' * (m - 1))
		else:
			print('.' * (m - 1) + '#')
		t = not t


def main():
	from sys import stdin, stdout
	(n, m) = map(int, stdin.readline().split())
	for i in range(n):
		if i & 3 & 1:
			if i & 3 == 1:
				stdout.write('.' * (m - 1) + '#\n')
			else:
				stdout.write('#' + '.' * (m - 1) + '\n')
		else:
			stdout.write('#' * m + '\n')
main()


n = input().split()
(n, m) = (int(n[0]), int(n[1]))
st = ''
for i in range(m):
	st += '#'
mid = st
st = st.replace('#', '.')
end = st[1:] + '#'
start = '#' + st[1:]
for i in range(1, n + 1):
	if i % 4 == 1 or i % 4 == 3:
		print(mid)
	elif i % 4 == 2:
		print(end)
	else:
		print(start)


(n, m) = map(int, input().split())

def f(n, m, r):
	if r == n:
		return
	elif r % 4 == 0:
		print('#' * m)
	elif r % 4 == 1:
		print('.' * (m - 1) + '#')
	elif r % 4 == 2:
		print('#' * m)
	elif r % 4 == 3:
		print('#' + '.' * (m - 1))
	f(n, m, r + 1)
f(n, m, 0)


a = input().split()
for b in range(int(a[0])):
	if b % 4 == 0 or b % 4 == 2:
		print('#' * int(a[1]))
	elif b % 4 == 1:
		print('.' * (int(a[1]) - 1) + '#')
	else:
		print('#' + '.' * (int(a[1]) - 1))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, m) = map(int, input().split())
ans = ['.'] * m
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	elif i % 2 == 0 and i % 4 == 0:
		ans[0] = '#'
		print(''.join(ans))
		ans[0] = '.'
	elif i % 4 != 0 or i % 2 == 0:
		ans[-1] = '#'
		print(''.join(ans))
		ans[-1] = '.'


(n, m) = map(int, input().split())
s1 = '#' * m
s2 = '.' * (m - 1) + '#'
s3 = '#' + '.' * (m - 1)
s = [s1, s2, s1, s3]
for i in range(n):
	print(s[i % 4])


(k, m) = list(map(int, input().split()))
p = k
q = m
while p != 0:
	print('#' * m)
	p -= 1
	if p != 0:
		print('.' * (m - 1) + '#')
		p -= 1
	if p != 0:
		print('#' * m)
		p -= 1
	if p != 0:
		print('#' + '.' * (m - 1))
		p -= 1


IN = input().split()
n = int(IN[0])
m = int(IN[1])
right = 1
for i in range(0, n):
	if i % 2 == 0:
		for j in range(0, m):
			print('#', end='')
		print()
	else:
		if right:
			for j in range(0, m - 1):
				print('.', end='')
			print('#')
		else:
			print('#', end='')
			for j in range(0, m - 1):
				print('.', end='')
			print()
		right ^= 1


(n, m) = map(int, input().split())
o = '#' * m
e1 = '.' * (m - 1) + '#'
e2 = '#' + '.' * (m - 1)
l = [o, e1, o, e2]
for i in range(n):
	print(l[i % 4])


lisa = input().split(' ')
for m in range(int(lisa[0])):
	v = int(lisa[1]) - 1
	i = m + 1
	if i % 2 == 1:
		print('#' * int(lisa[1]))
	elif i % 2 == 0:
		if i % 4 == 2:
			print('.' * v + '#')
		elif i % 4 == 0:
			print('#' + '.' * v)


(n, m) = map(int, input().split())
field = [['.' for i in range(m)] for j in range(n)]
for i in range(0, n, 2):
	field[i] = ['#' for i in range(m)]
for i in range(1, n, 2):
	if i % 4 == 1:
		field[i][m - 1] = '#'
	else:
		field[i][0] = '#'
for i in field:
	print(''.join(i))


(line, char) = input().split()
new_line = ''
line1 = int(line)
char1 = int(char)
for i in range(1, line1 + 1):
	if i % 4 == 2:
		for j in range(1, char1):
			new_line += '.'
		new_line += '#'
		print(new_line)
		new_line = ''
	elif i % 4 == 0:
		new_line += '#'
		for j in range(1, char1):
			new_line += '.'
		print(new_line)
		new_line = ''
	else:
		for j in range(1, char1 + 1):
			new_line += '#'
		print(new_line)
		new_line = ''


(row, column) = map(int, input().split())
for i in range(1, row + 1):
	if i % 2 != 0:
		print('#' * column)
	elif i // 2 % 2 != 0:
		print('.' * (column - 1) + '#')
	else:
		print('#' + '.' * (column - 1))


def trial():
	(n, m) = list(map(int, input().split()))
	if n % 2 == 0:
		return
	odd = '.' * (m - 1)
	counter = 1
	for i in range(n):
		if i % 2 == 0:
			print('#' * m)
		elif counter % 2 != 0:
			counter += 1
			print(odd + '#')
		elif counter % 2 == 0:
			counter += 1
			print('#' + odd)
trial()


(rows, columns) = map(int, input().split())
drugi = False
for x in range(1, rows + 1):
	if x % 2 != 0:
		for y in range(0, columns):
			print('#', end='')
	elif drugi == False:
		for y in range(1, columns):
			print('.', end='')
		print('#', end='')
		drugi = True
	elif drugi == True:
		print('#', end='')
		for y in range(1, columns):
			print('.', end='')
		drugi = False
	print(' ')


ip = input()
ipArr = ip.split(' ')
opp = False
height = int(ipArr[0])
width = int(ipArr[1])
for i in range(height):
	if (i + 1) % 2 == 0:
		if opp == False:
			for n in range(width - 1):
				print('.', end='')
			print('#')
			opp = True
		else:
			print('#', end='')
			for k in range(width - 2):
				print('.', end='')
			print('.')
			opp = False
	else:
		for j in range(width - 1):
			print('#', end='')
		print('#')


(n, m) = map(int, input().split())
l = [['0'] * m for i in range(n)]
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			l[i][j] = '#'
		elif i % 4 == 1 and j == m - 1:
			l[i][j] = '#'
		elif i % 4 == 3 and j == 0:
			l[i][j] = '#'
		else:
			l[i][j] = '.'
for i in range(n):
	for j in range(m):
		print(l[i][j], sep='', end='')
	print()


def output(var):
	list = []
	if var == 0:
		for i in range(1, m + 1):
			list.append('#')
		print(''.join(list))
	elif var == 1:
		for i in range(1, m):
			list.append('.')
		list.append('#')
		print(''.join(list))
	else:
		list.append('#')
		for i in range(1, m):
			list.append('.')
		print(''.join(list))
inp = [int(i) for i in input().split()]
m = inp[1]
n = inp[0]
for i in range(1, n + 1):
	if i % 2 != 0:
		output(0)
	elif i % 4 != 0:
		output(1)
	else:
		output(2)


x = list(map(int, input().split(' ')))
r = False
for i in range(x[0]):
	if i % 2 != 0:
		if r == False:
			print('.' * (x[1] - 1) + '#')
			r = True
		else:
			print('#' + '.' * (x[1] - 1))
			r = False
	else:
		print('#' * x[1])


(N, M) = map(int, input().split())
for n in range(N):
	if n % 2 == 0:
		print('#' * M)
	elif n % 4 == 1:
		print('.' * (M - 1) + '#')
	else:
		print('#' + '.' * (M - 1))


(n, m) = map(int, input().split())
t = '#' * m
l1 = '.' * (m - 1) + '#'
l2 = '#' + '.' * (m - 1)
for i in range(n):
	print([[t, t], [l1, l2]][i % 2][i // 2 % 2])


x = input().split()
a = int(x[0])
b = int(x[1])
re = ''
re1 = ''
c = 0
for i in range(b):
	re = re + '#'
for i in range(b - 1):
	re1 = re1 + '.'
for i in range(1, a + 1):
	if i % 2 == 0 and c == 1:
		print('#' + re1)
		c = 0
	elif i % 2 == 0:
		print(re1 + '#')
		c = 1
	else:
		print(re)


(n, m) = map(int, input().split())
sharps = '#' * m
dots = ['.' * (m - 1) + '#', '#' + '.' * (m - 1)]
now = 0
for i in range(n):
	if i & 1:
		print(dots[now])
		now ^= 1
	else:
		print(sharps)


import os
import sys
from io import BytesIO, IOBase
import math as M
import itertools as ITR
from collections import defaultdict as D
from collections import Counter as C
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools import cmp_to_key as CMP
from bisect import bisect_left as BL
from bisect import bisect_right as BR
import random as R
import string
import cmath, time
enum = enumerate
start_time = time.time()
MOD = 1000000007
MA = float('inf')
MI = float('-inf')
di8 = ((1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1))
di4 = ((1, 0), (0, 1), (-1, 0), (0, -1))

def increase_stack():
	sys.setrecursionlimit(2 ** 32 // 2 - 1)
	threading.stack_size(1 << 27)

def binary(n):
	return bin(n)[2:]

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def maxfactor(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
	if q:
		return q[-1]

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	l.sort()
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def seive(n):
	a = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p ** 2, n + 1, p):
				prime[i] = False
		p = p + 1
	for p in range(2, n + 1):
		if prime[p]:
			a.append(p)
	prime[0] = prime[1] = False
	return (a, prime)

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(M.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countchar(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def str_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q

def lis(arr):
	n = len(arr)
	lis = [1] * n
	maximum = 0
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
				maximum = max(maximum, lis[i])
	return maximum

def lcm(arr):
	a = arr[0]
	val = arr[0]
	for i in range(1, len(arr)):
		gcd = gcd(a, arr[i])
		a = arr[i]
		val *= arr[i]
	return val // gcd

def ncr(n, r):
	return M.factorial(n) // (M.factorial(n - r) * M.factorial(r))

def npr(n, r):
	return M.factorial(n) // M.factorial(n - r)

def IF(c, t, f):
	return t if c else f

def YES(c):
	print(IF(c, 'YES', 'NO'))

def Yes(c):
	print(IF(c, 'Yes', 'No'))

def yes(c):
	print(IF(c, 'yes', 'no'))

def JA(a, sep=' '):
	print(sep.join(map(str, a)))

def JAA(a, s='\n', t=' '):
	return s.join((t.join(map(str, b)) for b in a))

def PS(a, s=' '):
	print(str(a), end=s)

def I():
	return int(inp())

def F():
	return float(inp())

def LI():
	return list(map(int, inp().split()))

def LF():
	return list(map(float, inp().split()))

def MATI(n):
	return [LI() for i in range(n)]

def MATS(n):
	return [list(inp()) for i in range(n)]

def IV():
	return map(int, inp().split())

def FV():
	return map(float, inp().split())

def LS():
	return list(inp())

def S():
	return inp()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
inp = lambda : sys.stdin.readline().rstrip('\r\n')
TestCases = 0

def solve():
	(n, m) = IV()
	c = 0
	d = 0
	for i in range(n):
		if c % 2 == 0:
			print('#' * m)
		else:
			if d % 2 == 0:
				PS('.' * (m - 1) + '#')
			else:
				PS('#' + '.' * (m - 1))
			print()
			d += 1
		c += 1

def main():
	flag = 1
	try:
		sys.stdin = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/input.txt', 'r')
		sys.stdout = open('c:/Users/Manoj Chowdary/Documents/python/CodeForces/contest-div-2/output.txt', 'w')
	except:
		flag = 0
	t = 1
	if TestCases:
		t = I()
	for _ in range(1, t + 1):
		solve()
	if flag:
		print('Time: %.4f sec' % (time.time() - start_time))
		localtime = time.asctime(time.localtime(time.time()))
		print(localtime)
		sys.stdout.close()
main()


(n, m) = map(int, input().split())
hash_string = '#' * m
dot_string = '.' * (m - 1) + '#'
dot_string_reversed = '#' + '.' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		print(hash_string)
	elif i % 4 == 1:
		print(dot_string)
	elif i % 4 == 3:
		print(dot_string_reversed)
	else:
		pass


(n, m) = map(int, input().strip().split(' '))
for i in range(1, n + 1):
	if i % 2 == 0:
		if i % 4 == 0:
			print('#'.ljust(m, '.'))
		else:
			print('#'.rjust(m, '.'))
	else:
		print('#' * m)


x = [int(a) for a in input().split()]
a = x[0]
b = x[1]
check = int(0)
for i in range(0, a):
	if i % 2 == 0:
		print('#' * b)
	else:
		check += 1
		if check == 1:
			print('.' * (b - 1) + '#')
		elif check == 2:
			print('#' + '.' * (b - 1))
			check = 0


pieces = input().split()
n = int(pieces[0])
m = int(pieces[1])
lines = [0] * 4
lines[0] = ''.join(['#'] * m)
lines[1] = ''.join(['.'] * (m - 1) + ['#'])
lines[2] = ''.join(['#'] * m)
lines[3] = ''.join(['#'] + ['.'] * (m - 1))
for i in range(n):
	print(lines[i % 4])


nm = input().split()
for i in range(int(nm[0])):
	if i % 2 == 0:
		print('#' * int(nm[1]))
	elif i == 1:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 5:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 9:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 13:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 17:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 21:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 25:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 29:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 33:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 37:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 41:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 45:
		print('.' * (int(nm[1]) - 1) + '#')
	elif i == 49:
		print('.' * (int(nm[1]) - 1) + '#')
	else:
		print('#' + (int(nm[1]) - 1) * '.')


(n, m) = [int(x) for x in input().split()]
left = False
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if left:
			print('#' + '.' * (m - 1))
		else:
			print('.' * (m - 1) + '#')
		left = not left


(n, m) = map(int, input().split())
ans = [['.' for i in range(m)] for j in range(n)]
for i in range(n):
	if i % 2:
		if i % 4 == 1:
			ans[i][m - 1] = '#'
		else:
			ans[i][0] = '#'
	else:
		for j in range(m):
			ans[i][j] = '#'
for i in range(n):
	for j in range(m):
		print(ans[i][j], end='')
	print()


s = list(map(int, input().split(' ')))
(n, b) = (s[0], s[1])
i = 1
for x in range(1, n + 1):
	if x % 2 == 1:
		print('#' * b)
	elif i % 2 == 0:
		print('#', end='')
		print('.' * (b - 1))
		i = i + 1
	else:
		print('.' * (b - 1), end='')
		print('#')
		i = i + 1


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 == 1:
		s = '#' * m
		print(s)
	elif i % 2 == 0 and (not i % 4 == 0):
		s = '.' * (m - 1) + '#'
		print(s)
	else:
		s = '#' + '.' * (m - 1)
		print(s)


import sys
from math import *
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
from collections import defaultdict as df
import heapq
infinite = float('inf')
(n, m) = RI()
for i in range(n):
	if i % 4 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	elif i % 4 == 2:
		print('#' * m)
	else:
		print('#' + '.' * (m - 1))


l = [int(x) for x in input().split()]
flag = True
for i in range(2, l[0] + 2):
	if i % 2 == 0:
		print('#' * l[1])
	elif flag:
		print('.' * (l[1] - 1), end='#\n')
		flag = False
	else:
		print('#', end='')
		print('.' * (l[1] - 1))
		flag = True


(n, m) = map(int, input().split())
snake = []
c = 0
for i in range(n):
	a = []
	if i % 2 == 0:
		for j in range(m):
			a.append('#')
		c = 1 - c
	else:
		for j in range(m):
			if c == 1:
				if j < m - 1:
					a.append('.')
				else:
					a.append('#')
			elif j == 0:
				a.append('#')
			else:
				a.append('.')
	snake.append(a)
for k in range(len(snake)):
	s = ''.join(snake[k])
	print(s)


(n, m) = map(int, input().split())
temp = True
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 0:
			if temp:
				if j != m:
					print('.', end='')
				else:
					print('#', end='')
			elif j == 1:
				print('#', end='')
			else:
				print('.', end='')
		else:
			print('#', end='')
	if i % 2 == 0:
		temp = not temp
	print()


(n, m) = map(int, input().split())
out = []
for i in range(1, n + 1):
	if i % 2:
		out.append(''.join(['#'] * m))
	elif i % 4:
		out.append(''.join(['.'] * (m - 1) + ['#']))
	else:
		out.append(''.join(['#'] + ['.'] * (m - 1)))
for line in out:
	print(line)


(a, b) = map(int, input().split())
c = []
for i in range(a):
	c.append([])
for i in range(a):
	for g in range(b):
		c[i].append('.')
for i in range(0, a, 2):
	for j in range(b):
		c[i][j] = '#'
for i in range(1, a, 4):
	c[i][b - 1] = '#'
for i in range(3, a, 4):
	c[i][0] = '#'
for i in range(a):
	for j in range(b):
		print(c[i][j], end='')
	print()


i = list(map(int, input().split()))
jbaris = i[0]
jkolum = i[1]
if jbaris % 2 == 1:
	for baris in range(1, jbaris + 1):
		if baris % 2 != 0:
			print('#' * jkolum)
		elif baris % 4 == 0:
			print('#' + '.' * (jkolum - 1))
		else:
			print('.' * (jkolum - 1) + '#')


(n, m) = map(int, input().split())
a = '#' * m
b = '.' * (m - 1)
while True:
	if n == 0:
		break
	n -= 1
	print(a)
	if n == 0:
		break
	n -= 1
	print(b, '#', sep='')
	if n == 0:
		break
	n -= 1
	print(a)
	if n == 0:
		break
	n -= 1
	print('#', b, sep='')


(a, b) = map(int, input().split())
x = 0
for i in range(1, a + 1):
	if i % 2 == 1:
		print('#' * b)
	elif x % 2 == 0:
		print('.' * (b - 1), '#', sep='')
		x += 1
	elif x % 2 == 1:
		print('#', '.' * (b - 1), sep='')
		x += 1


(x, y) = map(int, input().split())
side = True
for i in range(1, x + 1):
	if i % 2 == 1:
		for j in range(y):
			print('#', end='')
	elif side:
		for j in range(y - 1):
			print('.', end='')
		print('#', end='')
		side = False
	else:
		print('#', end='')
		for j in range(1, y):
			print('.', end='')
		side = True
	print()


x = input().split(' ')
rows = int(x[0])
columns = int(x[1])
aux = 0
for i in range(rows):
	line = ''
	for j in range(columns):
		if i % 2 == 0:
			line += '#'
		elif aux == 0:
			if j == columns - 1:
				line += '#'
			else:
				line += '.'
		elif aux == 1:
			if j == 0:
				line += '#'
			else:
				line += '.'
	if line[columns - 1] == '#' and line[0] == '.':
		aux = 1
	elif line[columns - 1] == '.' and line[0] == '#':
		aux = 0
	print(line)


(n, m) = [int(k) for k in input().split()]
for i in range(1, n + 1):
	if i % 2 == 1:
		tempt = '#' * m
	elif i % 4 == 2:
		tempt = '.' * (m - 1) + '#'
	else:
		tempt = '#' + '.' * (m - 1)
	print(tempt)


def solve(n, m):
	for i in range(1, n + 1):
		if i % 4 == 2:
			for j in range(m - 1):
				print('.', end='')
			print('#')
		elif i % 4 == 0:
			print('#', end='')
			for k in range(m - 1):
				print('.', end='')
			print()
		else:
			for l in range(m):
				print('#', end='')
			print()
(n, m) = map(int, input().split())
solve(n, m)


values = input().split()
(n, m) = (int(values[0]), int(values[1]))
unit = ''
dots = ''
for i in range(m):
	unit += '#'
for j in range(m - 1):
	dots += '.'
for k in range(n):
	if k % 2 == 0:
		print(unit)
	elif k % 4 == 3:
		print('#' + dots)
	else:
		print(dots + '#')


lst = input()
main = lst.split()
r = int(main[0])
c = int(main[1])
sw = 'left'
for i in range(1, r + 1):
	for j in range(1, c + 1):
		if i % 2 == 1:
			print('#', end='')
	if sw == 'left' and i % 2 == 0:
		print((c - 1) * '.' + '#')
		sw = 'right'
	elif sw == 'right' and i % 2 == 0:
		print('#' + (c - 1) * '.')
		sw = 'left'
	if i % 2 == 1:
		print()


(n, m) = map(int, input().split())
mat = [[0 for i in range(m)] for i in range(n)]
chk = 1
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			mat[i][j] = '#'
		elif i % 2 != 0:
			if chk % 2 == 0:
				if j == 0:
					mat[i][j] = '#'
				else:
					mat[i][j] = '.'
			elif j == m - 1:
				mat[i][j] = '#'
			else:
				mat[i][j] = '.'
	if i % 2 != 0:
		chk += 1
for i in mat:
	print(''.join(i))


right = True
(a, b) = map(int, input().split())
for i in range(0, a):
	if i % 2 == 0:
		print('#' * b)
	elif i % 2 == 1 and right == True:
		print('.' * (b - 1) + '#')
		right = False
	elif i % 2 == 1 and right == False:
		print('#' + '.' * (b - 1))
		right = True


a = []
a = input().split()
n = int(a[0])
m = int(a[1])
for r in range(1, n + 1):
	s = ''
	q = r / 2
	if r % 2 != 0:
		for c in range(0, m):
			s = s + '#'
		print(s)
	elif q % 2 != 0:
		for c in range(0, m - 1):
			s = s + '.'
		print(s + '#')
	else:
		for i in range(0, m - 1):
			s = s + '.'
		print('#' + s)


a = list(map(int, input().split()))
b = a[1]
a = a[0]
i = 0
while i < a:
	if i % 4 == 0 or i % 4 == 2:
		print('#' * b)
	if i % 4 == 1:
		print((b - 1) * '.' + '#')
	if i % 4 == 3:
		print('#' + (b - 1) * '.')
	i = i + 1


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return (self.nextint() for i in range(n))

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
(n, m) = nextints(2)
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif (i - 1) % 4 == 0:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


(a, b) = (int(x) for x in input().split())
rev = 1
for i in range(1, a + 1):
	if i % 2 == 0:
		res = '.' * (b - 1) + '#'
		if rev % 2 == 0:
			print(res[::-1])
		else:
			print(res)
		rev += 1
	else:
		print('#' * b)


s = input().split(' ')
n = int(s[0])
m = int(s[1])
l = 0
for k in range(n):
	if k % 2 == 0:
		print('#' * m)
	else:
		if l % 2 == 0:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		l += 1


art = 0
num = input()
num = num.split(' ')
a = int(num[0])
b = int(num[1])

def start(n):
	for j in range(int(n)):
		if j == 0:
			print('#', end='')
		else:
			print('.', end='')

def end(n):
	for j in range(int(n)):
		if j == n - 1:
			print('#', end='')
		else:
			print('.', end='')

def normal(n):
	for i in range(n):
		print('#', end='')
for i in range(a):
	if i % 2 == 0:
		normal(b)
		print()
		continue
	elif art % 2 == 0:
		end(b)
		print()
		art += 1
		continue
	else:
		start(b)
		print()
		art += 1
		continue


input_data = input().split(' ')
n = int(input_data[0])
m = int(input_data[1])
res = []
r = '#'
d = '.'
check = True
for i in range(1, n + 1):
	if i % 2 != 0:
		res.append([r for i in range(m)])
	elif check:
		res.append([d for i in range(m - 1)] + list(r))
		check = False
	else:
		res.append(list(r) + [d for i in range(m - 1)])
		check = True
for row in res:
	for elem in row:
		print(elem, end='')
	print()


(row, col) = input().split()
mat = []
for i in range(0, int(row)):
	mat.append([])
for i in range(0, int(row), 2):
	for j in range(0, int(col)):
		mat[i].append('#')
for i in range(1, int(row), 2):
	for j in range(0, int(col)):
		mat[i].append('.')
for i in range(1, int(row), 4):
	del mat[i][int(col) - 1]
	mat[i].append('#')
for i in range(3, int(row), 4):
	del mat[i][0]
	mat[i].insert(0, '#')
for i in range(0, int(row)):
	for j in range(0, int(col)):
		print(mat[i][j], end='')
	if i < int(row):
		print('')


(n, m) = map(int, input().split())
w = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
for x in range(n):
	print(w[x % 4])


def main():
	(n, m) = [int(v) for v in input().split()]
	for i in range(0, n):
		if i % 2 == 0:
			print('#' * m)
		elif i % 4 == 3:
			print('#' + '.' * (m - 1))
		elif i % 4 == 1:
			print('.' * (m - 1) + '#')
main()


(n, m) = [int(x) for x in input().split()]
b = [[0] * m for i in range(n)]
snake = [['#'] * (m + 1) for i in range(n)]
for i in range(m + 1):
	for j in range(1, (n - 1) // 2 + 1):
		snake[j * 2 - 1][i] = '.'
for i in range(1, (n - 1) // 2 + 1):
	snake[i * 2 - 1][(-1) ** i] = '#'
for i in range(n):
	for j in range(m):
		b[i][j] = snake[i][j + 1]
for i in range(n):
	print(''.join((str(x) for x in b[i])))


(x, y) = [int(i) for i in input().split()]
for i in range(1, x + 1):
	if i % 2 == 1:
		for j in range(y):
			print('#', end='')
		print()
	else:
		if i % 4 == 2:
			for j in range(y - 1):
				print('.', end='')
			print('#')
		if i % 4 == 0:
			print('#', end='')
			for j in range(y - 1):
				print('.', end='')
			print()


judge = True
if judge:
	from sys import stdin, stdout
else:
	stdin = open('input.txt')
	stdout = open('output.txt', 'w')
(n, m) = map(int, stdin.readline().split())
body = '#' * m + '\n'
space = '.' * (m - 1)
turn = [space + '#\n', '#' + space + '\n']
stdout.write(body)
k = 0
for i in range(n // 2):
	stdout.write(turn[k])
	stdout.write(body)
	k ^= 1
if not judge:
	stdin.close()
	stdout.close()


(n, m) = [int(x) for x in input().split()]
direction = 1
for j in range(n):
	if j % 2 == 0:
		print(''.join(['#' for _ in range(m)]))
	elif direction == 1:
		direction = -1
		print(''.join(['.' for _ in range(m - 1)]) + '#')
	else:
		direction = 1
		print('#' + ''.join(['.' for _ in range(m - 1)]))


(a, b) = map(int, input().split())
for i in range(a):
	print('.' * (b - 1) + '#' if i % 4 == 1 else '#' + '.' * (b - 1) if i % 4 == 3 else '#' * b)


(n, m) = [int(i) for i in input().split()]
even = 'r'
thisline = 'odd'
for i in range(n):
	if thisline == 'odd':
		for j in range(m):
			print('#', end='')
		thisline = 'even'
	else:
		if even == 'r':
			for j in range(m - 1):
				print('.', end='')
			print('#', end='')
			even = 'l'
		else:
			print('#', end='')
			for j in range(m - 1):
				print('.', end='')
			even = 'r'
		thisline = 'odd'
	print('')


def swap():
	global a
	global x
	(a, x) = (x, a)

def printing():
	if x == 0:
		for i in range(pattern[1] - 1):
			print('.', end='')
		print('#')
		swap()
	else:
		print('#', end='')
		for i in range(pattern[1] - 1):
			print('.', end='')
		print()
		swap()
a = 1
x = 0
pattern = list(map(int, input().split(' ')))
for i in range(pattern[0]):
	if i % 2 == 0:
		for j in range(pattern[1]):
			print('#', end='')
		print()
	else:
		printing()


def main():
	(n, m) = map(int, input().split(' '))
	k = m - 1
	c = m - 1
	for i in range(n):
		if i % 2 == 0:
			for j in range(m):
				print('#', end='')
		elif i % 2 != 0:
			for q in range(k + 1):
				if q == c:
					print('#', end='')
				else:
					print('.', end='')
			if c == m - 1:
				c = 0
			else:
				c = m - 1
		print()
main()


(n, m) = tuple(map(int, input().split()))
ody = ''
eve = ''
ev4 = '#'
for i in range(m):
	ody += '#'
for i in range(m - 1):
	eve += '.'
ev4 += eve
eve += '#'
for i in range(1, n + 1):
	if i % 4 == 0 and int(i / 2) % 2 == 0:
		print(ev4)
	elif i % 2 == 0:
		print(eve)
	else:
		print(ody)


x = input().split()
a = 0
for i in range(int(x[0])):
	if i % 2 == 0:
		print('#' * int(x[1]))
	else:
		if a % 2 == 1:
			print('#' + '.' * (int(x[1]) - 1))
		else:
			print('.' * (int(x[1]) - 1) + '#')
		a += 1


n = list(map(int, input().split()))
a = ''
ch1 = False
for i in range(n[0]):
	if ch1:
		if len(a) != 0:
			if a[0] == '#':
				a = (n[1] - 1) * '.' + '#'
				print(a)
			else:
				a = '#' + (n[1] - 1) * '.'
				print(a)
		else:
			a = (n[1] - 1) * '.' + '#'
			print(a)
		ch1 = False
	else:
		print(n[1] * '#')
		ch1 = True


(n, m) = input().split()
n = int(n)
m = int(m)
i = 1
flag = True
while i <= n:
	j = 1
	if i % 2 != 0:
		while j < m:
			print('#', end='')
			j = j + 1
		print('#')
	elif flag:
		while j < m:
			print('.', end='')
			j = j + 1
		print('#')
		flag = False
	else:
		print('#', end='')
		while j < m:
			print('.', end='')
			j = j + 1
		print()
		flag = True
	i = i + 1


(n, m) = map(int, input().split())
for l in range(n):
	r = ''
	if l % 2 == 0:
		r += m * '#'
	elif l % 4 == 1:
		r += (m - 1) * '.' + '#'
	else:
		r += '#' + (m - 1) * '.'
	print(r)


(n, m) = map(int, input().split())
a = 1
while True:
	if a <= n:
		if a % 4 == 1 or a % 4 == 3:
			print('#' * m)
		if a % 4 == 2:
			print('.' * (m - 1) + '#')
		if a % 4 == 0:
			print('#' + '.' * (m - 1))
	if a > n:
		break
	a += 1


(n, m) = map(int, input().split())
a = True
for i in range(n):
	if i % 2 == 0:
		print(m * '#')
		a = not a
	elif a == False:
		print((m - 1) * '.' + '#')
	elif a:
		print('#' + (m - 1) * '.')


(n_val, m_val) = list(map(int, input().split()))
row = 1
while row <= n_val:
	if row % 4 == 1 or row % 4 == 3:
		print('#' * m_val)
	elif row % 4 == 2:
		print('.' * (m_val - 1) + '#')
	else:
		print('#' + '.' * (m_val - 1))
	row += 1


(a, b) = list(map(int, input().split()))
x = '#' * b
f = 0
for i in range(1, a + 1):
	if i % 2 == 1:
		print(x)
	else:
		y = '.' * (b - 1)
		if f % 2 == 0:
			y += '#'
		else:
			y = '#' + y
		f += 1
		print(y)


(n, m) = map(int, input().split())
a = [['.' for i in range(m)] for j in range(n)]
for i in range(0, n, 2):
	a[i] = ['#' for i in range(m)]
c = 0
for i in range(1, n, 2):
	a[i][c - 1] = '#'
	c ^= 1
for i in range(n):
	print(''.join(a[i]))


x = input().split()
h = '#'
d = '.'
v = int(x[0])
b = int(x[1])
c = 0
while v != 0:
	if v % 2 != 0:
		print(b * h)
	elif c == 0:
		print((b - 1) * d + h)
		c = 1
	else:
		print(h + (b - 1) * d)
		c = 0
	v = v - 1


l1 = [int(i) for i in input().split(' ')]
c = 0
for i in range(l1[0] - 1):
	if c == 0:
		print('#' * l1[1])
		c = 1
	if i % 4 == 0 and i % 2 == 0:
		print('.' * (l1[1] - 1), end='')
		print('#')
		c = 0
	elif i % 2 == 0:
		print('#', end='')
		print('.' * (l1[1] - 1))
		c = 0


(x, y) = list(map(int, input().split()))
flag = 0
for i in range(x):
	if flag == 0:
		print('#' * y)
	elif flag == 1:
		dot = '.' * (y - 1)
		print(dot + '#')
	elif flag == 2:
		print('#' * y)
	elif flag == 3:
		dot = '.' * (y - 1)
		print('#' + dot)
	flag += 1
	if flag > 3:
		flag = 0


(n, m) = map(int, input().split())
x = '#'
y = '.'
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(m):
			print(f'{x}', end='')
		print()
	else:
		if i % 4 == 0:
			print(x, end='')
			for j in range(m - 1):
				print(f'{y}', end='')
		else:
			for j in range(m - 1):
				print(f'{y}', end='')
			print(x, end='')
		print()


(r, c) = [int(x) for x in input().split()]
for i in range(1, r + 1):
	if i % 2 == 1:
		print('#' * c)
	elif i % 4 == 0:
		print('#' * 1, end='')
		print('.' * (c - 1))
	elif i % 2 == 0:
		print('.' * (c - 1), end='')
		print('#' * 1)


def snake(n, m):
	j = 0
	for i in range(n):
		if i % 2 == 0:
			print('#' * m)
		elif j % 2 == 0:
			print('.' * (m - 1) + '#')
			j = j + 1
		else:
			print('#' + '.' * (m - 1))
			j = j + 1
(n, m) = map(int, input().split())
snake(n, m)


(n, m) = map(int, input().split())
left = True
even_turn = False
for _ in range(n):
	if not even_turn:
		print('#' * m)
	else:
		if left:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		left = not left
	even_turn = not even_turn


(a, b) = input().split(' ')
a = int(a)
b = int(b)
x = 0
y = 0
for i in range(a):
	if x == 0:
		print('#' * b)
		x += 1
		continue
	if x == 1 and y == 0:
		print('.' * (b - 1) + '#')
		y = 1
		x = 0
		continue
	if x == 1 and y == 1:
		print('#' + '.' * (b - 1))
		y = 0
		x = 0
		continue


(strings, columns) = map(int, input().split())
x = 0
for i in range(strings):
	if i % 2 == 0:
		print('#' * columns)
	elif i % 2 != 0 and x == 0:
		print('.' * (columns - 1) + '#')
		x = 1
	elif i % 2 != 0 and x == 1:
		print('#' + '.' * (columns - 1))
		x = 0


a = '#'
b = '.'
c = '#'
o = 3
(n, m) = map(int, input().split())
for i in range(0, m - 1):
	a += '#'
	c += '.'
for i in range(0, m - 2):
	b += '.'
b += '#'
for i in range(0, n):
	if i % 2 == 0:
		print(a)
	elif i != o:
		print(b)
	else:
		print(c)
		o += 4


(N, M) = map(int, input().split())
Switch = 1
for i in range(1, N + 1):
	if i % 2 != 0:
		for j in range(1, M + 1):
			print('#', end='')
		print()
	elif Switch == 1:
		Switch = 0
		for j in range(1, M):
			print('.', end='')
		print('#')
	else:
		Switch = 1
		print('#', end='')
		for j in range(2, M + 1):
			print('.', end='')
		print()


def Serpiente(N, M):
	A = []
	if N % 2 == 0:
		if N % 4 == 0:
			A.append('#')
			for k in range(1, M):
				A.append('.')
		else:
			for k in range(0, M - 1):
				A.append('.')
			A.append('#')
	else:
		for k in range(M):
			A.append('#')
	return A
L = input()
L = L.split()
n = int(L[0])
m = int(L[1])
for k in range(1, n + 1):
	S = Serpiente(k, m)
	A = ''.join(S)
	print(A)


(r, c) = input().split()
cond_puntos = True
for repetir_filas in range(1, int(r) + 1):
	str_imprimir = ' '
	if repetir_filas % 2 == 0:
		if cond_puntos:
			for repetir_columnas in range(1, int(c)):
				str_imprimir += '.'
				cond_puntos = False
			str_imprimir += '#'
		else:
			str_imprimir += '#'
			for repetir_columnas in range(1, int(c)):
				str_imprimir += '.'
				cond_puntos = True
	else:
		for repetir_columnas in range(1, int(c) + 1):
			str_imprimir += '#'
	print(str_imprimir)


inp = input().split()
inp = [int(i) for i in inp]
lenght = inp[1]
lines = [int(i) for i in range(1, 1 + inp[0])]
for e in lines:
	if e % 2 != 0:
		print('#' * lenght)
	elif e % 4 == 0:
		print('#' + '.' * (lenght - 1))
	else:
		print('.' * (lenght - 1) + '#')


(n, m) = map(int, input().split())
for i in range(n):
	if not i % 2:
		print('#' * m)
	else:
		b = i
		b += 1
		p = '.' * (m - 1)
		if b % 4 == 0:
			print('#' + p)
		else:
			print(p + '#')


ans = input().split()
n = int(ans[0])
m = int(ans[1])
right = True
for i in range(0, n):
	if i % 2 == 0:
		for j in range(0, m):
			print('#', end='')
		print('')
	elif right == True:
		for j in range(0, m - 1):
			print('.', end='')
		print('#')
		right = False
	else:
		print('#', end='')
		for j in range(0, m - 1):
			print('.', end='')
		print('')
		right = True


l = list(map(int, input().split()))
c = 1
for i in range(0, l[0]):
	for j in range(0, l[1]):
		if i % 2 == 0:
			print('#', end='')
		elif c == 1:
			if j == l[1] - 1:
				print('#', end='')
				c = 2
			else:
				print('.', end='')
		else:
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
			if j == l[1] - 1:
				c = 1
	print()


(n, m) = map(int, input().split())
p = 1
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print('#', end='')
	else:
		for j in range(m):
			if j == m - 1:
				if p == 1:
					print('#', end='')
				else:
					print('.', end='')
			if j == 0:
				if p == 0:
					print('#', end='')
				else:
					print('.', end='')
			if j != 0 and j != m - 1:
				print('.', end='')
		if p == 1:
			p = 0
		else:
			p = 1
	print()


(x, y) = map(int, input().split())
fl = 0
for i in range(x):
	if (i + 1) % 2 != 0:
		print('#' * y)
	elif fl == 0:
		print('.' * (y - 1) + '#')
		fl = 1
	elif fl == 1:
		print('#' + '.' * (y - 1))
		fl = 0


(row, col) = list(map(int, input().split()))
li = []
status = True
for i in range(row):
	s = ''
	for j in range(col):
		if i % 2 == 0:
			s += '#'
		elif i % 2 != 0 and status:
			if j == col - 1:
				s += '#'
			else:
				s += '.'
		elif j == 0:
			s += '#'
		else:
			s += '.'
	if i % 2 != 0:
		status = not status
	li.append(s)
for i in li:
	print(i)


(n, m) = map(int, input().split())
(L, R, k) = (False, True, 0)
for i in range(n):
	if i % 2 != 0:
		k += 1
	for j in range(m):
		if i % 2 == 0:
			if j != m - 1:
				print('#', end='')
			else:
				print('#')
		else:
			if k % 2 != 0:
				(L, R) = (False, True)
			else:
				(L, R) = (True, False)
			if L:
				if j == 0:
					print('#', end='')
				elif j == m - 1:
					print('.')
				else:
					print('.', end='')
			elif j == m - 1:
				print('#')
			else:
				print('.', end='')


(n, m) = map(int, input().split())
s = True
print('#' * m)
for i in range(n - 1):
	if i % 2 == 1:
		print('#' * m)
	elif s:
		print('.' * (m - 1) + '#')
		s = False
	else:
		print('#' + '.' * (m - 1))
		s = True


(n, m) = list(map(int, input().split()))
A = [['.' for i in range(m)] for j in range(n)]
counter_all = 0
counter_odd = 0
while counter_all < n:
	if counter_all % 2 == 0:
		A[counter_all] = ['#' for j in range(m)]
	else:
		if counter_odd % 2 == 0:
			A[counter_all][-1] = '#'
		else:
			A[counter_all][0] = '#'
		counter_odd += 1
	counter_all += 1
for i in range(n):
	for j in range(m):
		print(A[i][j], end='')
	print()


def func(n, m):
	s = '#'
	nos = s * m
	cells = '.' * (m - 1)
	k = True
	for i in range(0, n):
		if i % 2 == 0:
			print(nos)
		else:
			if k:
				print(cells + s)
			else:
				print(s + cells)
			k = not k
(n, m) = map(int, input().split(' '))
func(n, m)


(n, m) = map(int, input().split())
st = ''
t = True
for i in range(n):
	if i % 2 == 0:
		st1 = '#' * m
		st += st1 + '\n'
	else:
		if t:
			st1 = '.' * (m - 1) + '#'
			t = False
		else:
			st1 = '#' + '.' * (m - 1)
			t = True
		st += st1 + '\n'
print(st)


n = list(map(int, input().split()))
for i in range(1, n[0] + 1):
	if i % 2 == 1:
		print('#', end='')
	if i % 2 == 0:
		if i % 4 != 0:
			print('.', end='')
		if i % 4 == 0:
			print('#', end='')
	for j in range(1, n[1] - 1):
		if i % 2 == 1:
			print('#', end='')
		if i % 2 == 0:
			print('.', end='')
	if i % 2 == 1:
		print('#', end='')
	if i % 2 == 0:
		if i % 4 != 0:
			print('#', end='')
		if i % 4 == 0:
			print('.', end='')
	print()


(n, m) = map(int, input().split())
mat = []
c = 0
for i in range(n):
	if i % 2 == 0:
		pat = '#' * m
	else:
		if c % 2 == 0:
			pat = '.' * (m - 1) + '#'
		else:
			pat = '#' + '.' * (m - 1)
		c += 1
	mat.append(pat)
for i in range(n):
	print(mat[i])


(n, m) = list(map(int, input().split(' ')))
f = 0
for l in range(n):
	if l % 2 == 0:
		print('#' * m)
		f = 1 if f == 0 else 0
	elif f == 1:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


(n, m) = [int(i) for i in input().split()]
k = [m * [0] for j in range(n)]
(i, j) = (0, 0)
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			k[i][j] = '#'
	else:
		if i % 4 == 1:
			k[i][m - 1] = '#'
			for j in range(m - 1):
				k[i][j] = '.'
		if i % 4 == 3:
			k[i][0] = '#'
			for j in range(1, m):
				k[i][j] = '.'
(i, j) = (0, 0)
for i in range(n):
	print(''.join(k[i]))


Datos = input('')
Datos = Datos.split()
N = int(Datos[0])
M = int(Datos[1])
print('#' * M)
for K in range(1, N):
	if K % 2 != 0:
		if K % 4 == 1:
			print('.' * (M - 1) + '#')
		else:
			print('#' + '.' * (M - 1))
	else:
		print('#' * M)


(n, m) = [int(x) for x in input().split()]

def printHashes(num):
	for i in range(num):
		print('#', end='')

def printDots(num):
	for i in range(num - 1):
		print('.', end='')
rightSide = True
for i in range(n):
	if (i + 1) % 2 != 0:
		printHashes(m)
	elif rightSide:
		printDots(m)
		printHashes(1)
		rightSide = not rightSide
	else:
		printHashes(1)
		printDots(m)
		rightSide = not rightSide
	print('')


inp = input().split()
r = int(inp[0])
c = int(inp[1])
lines = 0
alt = 0
a = ''
b = ''
d = ''
ls1 = []
ls2 = []
for items in range(2, r, 4):
	ls1.append(items)
for items in range(4, r, 4):
	ls2.append(items)
for i in range(0, c):
	a += '#'
for i in range(0, c):
	if i == c - 1:
		b += '#'
	else:
		b += '.'
for i in range(0, c):
	if i == 0:
		d += '#'
	else:
		d += '.'
for itm in range(1, r + 1):
	if itm == 1 or itm % 2 != 0:
		print(a)
	elif itm in ls1:
		print(b)
	else:
		print(d)


(n, m) = map(int, input().split())
flag = False
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
		continue
	p = m - 1
	if flag:
		print('#' + '.' * p)
		flag = False
	else:
		print('.' * p + '#')
		flag = True


s = input().split()
n = int(s[0])
m = int(s[1])
a = [['#'] * m for i in range(n)]
for i in range(n):
	for z in range(m):
		if (i + 1) % 4 == 0:
			if z != 0:
				a[i][z] = '.'
		elif (i + 1) % 4 == 2:
			if z != m - 1:
				a[i][z] = '.'
for i in a:
	print(*i, sep='')


def main():
	settings = input().split()
	(n, m) = (int(settings[0]), int(settings[1]))
	right = True
	for i in range(n):
		if i % 2 == 0:
			row = '#' * m
			print(row)
		elif right == True:
			row = '.' * (m - 1) + '#'
			print(row)
			right = False
		else:
			row = '#' + '.' * (m - 1)
			print(row)
			right = True
main()


num = input().split()
lis = list(map(int, num))
num1 = lis[0]
num2 = lis[1]
c = 0
for x in range(num1):
	if x % 2 == 0:
		for y in range(num2):
			print('#', end='')
		print()
	else:
		if c % 2 == 0:
			for z in range(num2 - 1):
				print('.', end='')
			print('#')
		else:
			print('#', end='')
			for i in range(num2 - 2):
				print('.', end='')
			print('.')
		c += 1


(a, b) = map(int, input().split())
t = '.' * (b - 1) + '#'
for i in range(1, a + 1):
	if i % 2 == 1:
		print('#' * b)
	else:
		print(t)
		t = t[::-1]


[n, m] = [int(x) for x in input().split()]
boolean = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif boolean:
		print('{}#'.format('.' * (m - 1)))
		boolean = False
	else:
		print('#{}'.format('.' * (m - 1)))
		boolean = True


(n, m) = [int(x) for x in input().split()]
i = 1
if n == 3:
	while n != 0:
		if n % 2 == 1:
			print('#' * m)
		else:
			str1 = ('.' * (m - 1), '#')
			print(''.join(str1))
		n -= 1
else:
	while i <= n:
		if i % 2 == 1:
			print('#' * m)
		elif i // 2 % 2 == 0:
			str2 = ('#', '.' * (m - 1))
			print(''.join(str2))
		else:
			str1 = ('.' * (m - 1), '#')
			print(''.join(str1))
		i += 1


nm = input().split()
n = int(nm[0])
m = int(nm[1])
a = 1
b = 1
ans = ''
for x in range(n):
	if a % 2 != 0:
		ans += '#' * m + '\n'
	else:
		if b % 2 != 0:
			ans += '.' * (m - 1) + '#' + '\n'
		else:
			ans += '#' + '.' * (m - 1) + '\n'
		b += 1
	a += 1
print(ans[:-1])


(n, m) = map(int, input().split())

def judge_i(i, m):
	if i % 2 == 0:
		if i % 4 == 0:
			snake_line = '#' + '.' * (m - 1)
		else:
			snake_line = '.' * (m - 1) + '#'
	else:
		snake_line = '#' * m
	return snake_line
for i in range(1, n + 1):
	print(judge_i(i, m))


(q, l) = map(int, input().split(' '))
a = []
b = []
i = 0
j = 1
k = 0
while i < l:
	a.append('#')
	i += 1
while j < l:
	b.append('.')
	j += 1
b.append('#')
while k < q:
	print(''.join(a))
	k += 1
	if k == q:
		break
	print(''.join(b))
	k += 1
	if k == q:
		break
	print(''.join(a))
	k += 1
	if k == q:
		break
	print(''.join(reversed(b)))
	k += 1
	if k == q:
		break


(n, m) = (int(x) for x in input().split())
patterns = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
curr_pattern = 0
for i in range(n):
	print(patterns[curr_pattern])
	curr_pattern += 1
	curr_pattern %= 4


(n, m) = map(int, input().split())
string = ''.join(['#' for i in range(m)])
string_1 = ''.join(['.' for i in range(m - 1)]) + '#'
string_2 = '#' + ''.join(['.' for i in range(m - 1)])
check = True
for i in range(1, n + 1):
	if i % 2 != 0:
		print(string)
	elif check:
		check = not check
		print(string_1)
	else:
		check = not check
		print(string_2)


s = input().split()
n = int(s[0])
m = int(s[1])
right = True
for r in range(n):
	if r % 2 == 0:
		print('#' * m)
	else:
		l = '.' * (m - 1)
		print(l + '#' if right else '#' + l)
		right = not right


ch = input()
n = int(ch[0:ch.find(' ')])
m = int(ch[ch.find(' '):])
i = 0
bol = True
while i < n:
	if i % 2 == 0:
		print(m * '#')
		i += 1
	elif bol == True:
		print((m - 1) * '.' + '#')
		bol = False
		i += 1
	else:
		print('#' + (m - 1) * '.')
		bol = True
		i += 1


(n, m) = map(int, input().split())
st = 0
for i in range(n):
	if i % 2 == 0:
		print(m * '#')
	elif i % 2 != 0:
		if st % 2 == 0:
			print((m - 1) * '.' + '#')
			st += 1
		elif st % 2 != 0:
			print('#' + (m - 1) * '.')
			st += 1


(n, m) = [int(x) for x in input().split()]
for r in range(n):
	if r % 4 == 0 or r % 4 == 2:
		for c in range(m):
			print('#', end='')
		print('')
	elif r % 4 == 1:
		for c in range(m - 1):
			print('.', end='')
		print('#')
	else:
		print('#', end='')
		for c in range(m - 1):
			print('.', end='')
		print('')


from sys import stdin, stdout
(vert, horz) = map(int, stdin.readline().split())
for i in range(1, vert + 1):
	if i % 2 == 0:
		if i % 4 == 0:
			print('#' + '.' * (horz - 1))
		else:
			print('.' * (horz - 1) + '#')
	else:
		print('#' * horz)


nm = input().split(' ')
flag = True
for i in range(1, int(nm[0]) + 1):
	if i % 2 != 0:
		for j in range(int(nm[1]) - 1):
			print('#', end='')
		print('#')
	elif flag:
		for j in range(int(nm[1]) - 1):
			print('.', end='')
		print('#')
		flag = False
	else:
		print('#', end='')
		for j in range(int(nm[1]) - 2):
			print('.', end='')
		print('.')
		flag = True


(n, m) = map(int, input().split())
display = [['.'] * m for i in range(n)]
last = True
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			display[i][j] = '#'
	else:
		if last:
			display[i][m - 1] = '#'
		else:
			display[i][0] = '#'
		last = not last
for r in display:
	print(''.join(r))


e = input().split(' ')
n = int(e[0])
m = int(e[-1])
for i in range(n):
	print(['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)][i % 4])


(n, m) = map(int, input().split())
ans = []
for i in range(n):
	if i & 1:
		if (i - 1) // 2 & 1:
			r = ['#']
			r.extend(('.' for _ in range(m - 1)))
			ans.append(r)
		else:
			r = ['.' for _ in range(m - 1)]
			r.append('#')
			ans.append(r)
	else:
		ans.append(['#'] * m)
for i in range(n):
	for j in range(m):
		print(ans[i][j], end='')
	print()


(height, width) = map(int, input().split())
for row in range(height):
	if row % 2 == 0:
		print('#' * width)
	elif row % 4 == 1:
		print('.' * (width - 1) + '#')
	else:
		print('#' + '.' * (width - 1))


import sys

def main():
	(n, m) = [int(x) for x in sys.stdin.readline().strip().split()]
	left = True
	for i in range(n):
		if i % 2 == 0:
			left = not left
		for j in range(m):
			if i % 2 == 0:
				print('#', end='')
			elif left and j == 0:
				print('#', end='')
			elif not left and j == m - 1:
				print('#', end='')
			else:
				print('.', end='')
		print()
main()


e = [int(i) for i in input().split()]
(n, m) = (e[0], e[1])
res = []
right = 1
for i in range(n):
	if (i + 1) % 2 == 1:
		res.append(['#' * m])
	elif right:
		res.append(['.' * (m - 1), '#'])
		right = 0
	else:
		res.append(['#', '.' * (m - 1)])
		right = 1
for i in res:
	for j in i:
		print(j, end='')
	print('\t')


(n, m) = map(int, input().split(' '))
alt = 1
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif alt == 1 and j == m - 1 or (alt == -1 and j == 0):
			print('#', end='')
		else:
			print('.', end='')
	if i % 2 != 0:
		alt *= -1
	print()


(x, y) = map(int, input().split())
res = 1
con = 3
for i in range(x):
	if i % 2 == 0:
		print(y * '#')
	if res == i:
		print((y - 1) * '.' + '#')
		res += 4
	if con == i:
		print('#' + (y - 1) * '.')
		con += 4


(l, w) = map(int, input().split())
for i in range(1, l + 1):
	if i % 2 == 1:
		print('#' * w)
	elif i // 2 % 2 == 1:
		print('.' * (w - 1) + '#')
	else:
		print('#' + '.' * (w - 1))


(n, m) = list(map(int, input().split()))
i = 0
z = 0
while i < n:
	if i % 2 == 0:
		print('#' * m)
	else:
		if z % 2 == 0:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		z += 1
	i += 1


(a, b) = map(int, input().split())
d = False
while a > 0:
	print('#' * b)
	if d == False and a > 1:
		print('.' * (b - 1) + '#')
		d = True
	elif d == True and a > 1:
		print('#' + '.' * (b - 1))
		d = False
	a -= 2


(n, c) = map(int, input().split())
v = 1
s = c
for i in range(1, n // 2 + 1):
	print('#' * c)
	if v == 1:
		print('.' * (c - 1) + '#')
		v = 2
	else:
		print('#' + '.' * (c - 1))
		v = 1
print('#' * c)


(n, m) = input().split(' ')
n = int(n)
m = int(m)
k = 0
for i in range(n):
	if k % 4 == 0 or k % 4 == 2:
		print('#' * m)
	if k % 4 == 1:
		print('.' * (m - 1) + '#')
	if k % 4 == 3:
		print('#' + '.' * (m - 1))
	k += 1


(n, k) = list(map(int, input().split()))
count = 0
for i in range(1, n + 1):
	if i % 2 == 0 and count == 0:
		for j in range(k):
			if j != k - 1:
				print('.', end='')
			else:
				print('#', end='')
		count = 1
	elif i % 2 == 0 and count == 1:
		for j in range(k):
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
		count = 0
	else:
		for j in range(k):
			print('#', end='')
	print()


(n, m) = input().split()
n = int(n)
m = int(m)
snake = []
for i in range(n):
	line = []
	if i % 2 == 0:
		for j in range(m):
			line.append('#')
	elif i % 4 == 1:
		for j in range(m):
			if j == m - 1:
				line.append('#')
			else:
				line.append('.')
	else:
		for j in range(m):
			if j == 0:
				line.append('#')
			else:
				line.append('.')
	snake.append(line)
for i in range(n):
	for j in range(m):
		if j == m - 1:
			print(snake[i][j])
		else:
			print(snake[i][j], end='')


nm = input().split()
n = int(nm[0])
m = int(nm[1])
while n > 0:
	for i in range(m):
		print('#', end='')
	print()
	n -= 1
	if n <= 0:
		break
	for i in range(m - 1):
		print('.', end='')
	print('#')
	n -= 1
	if n <= 0:
		break
	for i in range(m):
		print('#', end='')
	print()
	n -= 1
	if n <= 0:
		break
	print('#', end='')
	for i in range(m - 1):
		print('.', end='')
	print()
	n -= 1
	if n < 0:
		break


(n, m) = [int(x) for x in input().split()]
answer = []
for i in range(1, n + 1):
	if i % 2 == 1:
		s = m * '#'
	elif i % 4 == 0:
		s = '#' + (m - 1) * '.'
	else:
		s = (m - 1) * '.' + '#'
	answer.append(s)
for x in answer:
	print(x)


def PrintSnake(n, m):
	countEven = 1
	finalResult = ''
	n = int(n)
	m = int(m)
	for i in range(0, n):
		if i % 2 == 0:
			finalResult += '#' * m + '\n'
		else:
			if countEven % 2 != 0:
				for j in range(0, m - 1):
					finalResult += '.'
				finalResult += '#\n'
			else:
				finalResult += '#'
				for j in range(1, m):
					finalResult += '.'
				finalResult += '\n'
			countEven += 1
	return finalResult
n = input().split(' ')
print(PrintSnake(n[0], n[1]))


from sys import stdin
(n, m) = map(int, stdin.readline().rstrip().split())
for x in range(n):
	if not x % 2:
		print('#' * m)
	elif x % 2 and (not (x + 1) % 4):
		print('#' + '.' * (m - 1))
	else:
		print('.' * (m - 1) + '#')


(rows, columns) = [int(i) for i in input().split()]
bol_var = False
for i in range(rows):
	if i % 2 == 0:
		print('#' * columns)
	elif bol_var:
		print('#' + '.' * (columns - 1))
		bol_var = False
	else:
		print('.' * (columns - 1) + '#')
		bol_var = True


import sys
numbers = [int(i) for i in sys.stdin.readline().split()]
n = numbers[0]
m = numbers[1]
j = 0
k = 0
while j < n:
	if j % 2 == 0:
		for i in range(m):
			print('#', end='')
		print()
	else:
		if k % 2 == 0:
			for i in range(m - 1):
				print('.', end='')
			print('#', end='')
			print()
		else:
			print('#', end='')
			for i in range(m - 1):
				print('.', end='')
			print()
		k += 1
	j += 1


(n, m) = map(int, input().split())
count = 0
x = '#' * m
y = '.' * (m - 1) + '#'
z = '#' + '.' * (m - 1)
for i in range(n):
	if count < n:
		print(x)
		count += 1
	if count < n:
		print(y)
		count += 1
	if count < n:
		print(x)
		count += 1
	if count < n:
		print(z)
		count += 1


(times, length) = input().split()
anse = int(length) - 1
anse2 = '.' * anse
flag = 1
for i in range(1, int(times) + 1, 1):
	if i % 2 != 0:
		print('#' * int(length))
	elif flag == 1:
		print(anse2 + '#')
		flag = 0
	else:
		print('#' + anse2)
		flag = 1


(n, m) = map(int, input().split(' '))
a = []
F = '#' * m
R = '.' * (m - 1) + '#'
L = '#' + '.' * (m - 1)
right = True
i = 0
while i < n:
	if right:
		a.append(F)
		a.append(R)
		right = False
	else:
		a.append(F)
		a.append(L)
		right = True
	i += 2
for i in range(n):
	print(a[i])


import sys

def data():
	return sys.stdin.readline().strip()

def sp():
	return map(int, data().split())

def l():
	return list(sp())
temp = l()
n = temp[0]
m = temp[1]
res = []
l = []
for i in range(1, n + 1):
	if i % 4 == 2:
		for j in range(1, m):
			print('.', end='')
		print('#')
	elif i % 4 == 0:
		print('#', end='')
		for j in range(1, m):
			print('.', end='')
		print()
	else:
		for j in range(1, m + 1):
			print('#', end='')
		print()


def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as c

def solve():
	(N, M) = getInts()
	for i in range(N):
		if i % 2 == 0:
			print('#' * M)
		elif i % 4 == 1:
			print('.' * (M - 1) + '#')
		else:
			print('#' + '.' * (M - 1))
	return
solve()


(n, m) = map(int, input().split())
rows = [] * n
for i in range(1, n + 1):
	if i % 2 == 1:
		rows.append('#' * m)
	elif i % 4 == 2:
		rows.append('.' * (m - 1) + '#')
	else:
		rows.append('#' + '.' * (m - 1))
for row in rows:
	print(row)


(a, b) = map(int, input().split())
lst = []
for i in range(a):
	if i % 2 == 0:
		lst.append(['#'] * b)
	else:
		lst.append(['.'] * b)
for i in range(3, a, 4):
	lst[i][0] = '#'
for i in range(1, a, 4):
	lst[i][b - 1] = '#'
for i in range(a):
	print(''.join(lst[i]))


size = str(input())
size = size.split(' ')
rows = int(size[0])
cols = int(size[1])
roww = ''
norr = ''
for n in range(cols - 1):
	roww = roww + '#'
	norr = norr + '.'
y = 0
x = 0
for n in range(rows):
	if x % 2 == 0:
		print(roww + '#')
		x += 1
	elif y % 2 == 0:
		print(norr + '#')
		y += 1
		x += 1
	else:
		print('#' + norr)
		y += 1
		x += 1


(n, m) = map(int, input().split())
odd = []
even = []
even2 = []
for i in range(m - 1):
	odd += '#'
	even += '.'
odd += '#'
even += '#'
even2 += '#'
for i in range(m - 1):
	even2 += '.'
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print(odd[j], end='')
	elif i % 4 == 1:
		for j in range(m):
			print(even[j], end='')
	else:
		for j in range(m):
			print(even2[j], end='')
	print()


(n, m) = map(int, input().split())
sharp = '#' * m
a = '.' * (m - 1) + '#'
b = '#' + '.' * (m - 1)
for i in range(n):
	if not i % 2:
		print(sharp)
	elif not i % 4 - 1:
		print(a)
	else:
		print(b)


l = input().split()
n = int(l[0])
m = int(l[1])
t1 = []
t2 = []
t3 = []
for i in range(m):
	t1.append('#')
for i in range(m):
	t2.append('.')
t2[-1] = '#'
for i in range(m):
	t3.append('.')
t3[0] = '#'
matrix = []
c = 2
for i in range(n):
	if i % 2 == 0:
		matrix.append(t1)
	elif c == 2:
		matrix.append(t2)
		c = 3
	elif c == 3:
		matrix.append(t3)
		c = 2
for i in range(n):
	s = ''.join(matrix[i])
	print(s)


(a, b) = [int(x) for x in input().split()]
i = 1
while i <= a:
	if i % 4 == 0:
		print('#' + '.' * (b - 1))
		i += 1
	elif i % 2 == 0:
		print('.' * (b - 1) + '#')
		i += 1
	else:
		print('#' * b)
		i += 1


(n, m) = map(int, input().split())

def num(x):
	temp = []
	for j in range(x):
		temp.append('#')
	print(''.join(temp))

def dot(x, y):
	if y // 2 % 2 == 1:
		temp = []
		for j in range(x - 1):
			temp.append('.')
		print(''.join(temp) + '#')
	else:
		temp = []
		for j in range(x - 1):
			temp.append('.')
		print('#' + ''.join(temp))
for i in range(1, n + 1):
	if i % 2 == 1:
		num(m)
	else:
		dot(m, i)


def main():
	(n, m) = input().split(' ')
	(n, m) = (int(n), int(m))
	str1 = '#' * m
	str2 = '.' * (m - 1) + '#'
	str3 = '#' + '.' * (m - 1)
	for i in range(1, n + 1):
		if (i - 2) % 4 == 0:
			print(str2)
		elif i % 4 == 0:
			print(str3)
		else:
			print(str1)
main()


(n, m) = map(int, input().split())
count = 0
for i in range(n):
	if i % 2 == 0:
		for i in range(m):
			print('#', end='')
		print()
	elif count % 2 == 0:
		a = ''
		for i in range(m - 1):
			a += '.'
		a += '#'
		print(a)
		count += 1
	else:
		a = '#'
		for i in range(1, m):
			a += '.'
		print(a)
		count += 1


(a, b) = (int(i) for i in input().split())
s = False
for i in range(a):
	if i % 2 == 0:
		print('#' * b)
	elif s == False:
		print('.' * (b - 1) + '#')
		s = True
	elif s == True:
		print('#' + '.' * (b - 1))
		s = False


(n, m) = map(int, input().split())
i = 0
k = 0
while i < n:
	j = 0
	if i % 2 == 0:
		if i % 4 == 0 and i != 0:
			print()
		while j < m:
			print('#', end='')
			j += 1
		print()
	else:
		if k % 2 == 0:
			while j < m - 1:
				print('.', end='')
				j += 1
			print('#')
		else:
			print('#', end='')
			j += 1
			while j < m:
				print('.', end='')
				j += 1
		k += 1
	i += 1


a = input()
s = ''
A = []
for i in a:
	if i == ' ':
		A.append(int(s))
		s = ''
	else:
		s += i
A.append(int(s))
b = A[1]
for i in range(A[0]):
	if i % 4 == 1:
		print((b - 1) * '.' + '#')
	elif i % 4 == 3:
		print('#' + (b - 1) * '.')
	else:
		print(b * '#')


enter = input().split()
counter0 = 0
z = True
x = True
y = True
while z:
	if y:
		print('#' * int(enter[1]))
		counter0 += 1
		if counter0 == int(enter[0]):
			break
	if x:
		e = int(enter[1])
		e -= 1
		print('.' * e + '#')
		counter0 += 1
		if counter0 == int(enter[0]):
			break
		x = False
	else:
		e = int(enter[1])
		e -= 1
		print('#' + '.' * e)
		counter0 += 1
		if counter0 == int(enter[0]):
			break
		x = True


(a, b) = map(int, input().split())
count = 0
f = '.' * (b - 1)
for i in range(1, a + 1):
	if not i % 2 == 0:
		print('#' * b)
	elif count == 0:
		print(f + '#')
		count += 1
	elif count == 1:
		print('#' + f)
		count -= 1


(n, m) = [int(x) for x in input().split()]
ans = ''
less = m - 1
last = n - 1
for r in range(n):
	if r % 2 == 0:
		ans += '#' * m
	elif r // 2 % 2 == 0:
		ans += '.' * less + '#'
	else:
		ans += '#' + '.' * less
	if r != last:
		ans += '\n'
print(ans)


(n, m) = [int(a) for a in input().split()]
List = ['#' * m]
right = True
for x in range(n):
	if right:
		List.append('.' * (m - 1) + '#')
		right = False
	else:
		List.append('#' + '.' * (m - 1))
		right = True
	List.append('#' * m)
for i in List[:n]:
	print(i)


(row, col) = map(int, input().split())
a = row
while a - row + 1 < a + 1:
	if (a - row + 1) % 2 != 0:
		print('#' * col)
	elif (a - row + 1) % 4 == 0:
		print('#'.ljust(col, '.'))
	else:
		print('#'.rjust(col, '.'))
	row = row - 1


(n, m) = map(int, input().split())
dotlist = []
count = 0
dotlist1 = ['#']
for i in range(n // 4 + 1):
	if count < n:
		print('#' * m)
		count += 1
	if count < n:
		for i in range(m - 1):
			dotlist.append('.')
		dotlist.append('#')
		print(*dotlist, sep='')
		count += 1
	if count < n:
		print('#' * m)
		count += 1
	if count < n:
		for j in range(m - 1):
			dotlist1.append('.')
		print(*dotlist1, sep='')
	count += 1
	dotlist = []
	dotlist1 = ['#']


(n, m) = map(int, input().split())

def output(a):
	for it in a:
		for c in it:
			if c == 1:
				print('#', end='')
			else:
				print('.', end='')
		print()
mas = [[0 for i in range(m)] for j in range(n)]
for i in range(n):
	if i % 2 == 0:
		mas[i] = [1 for j in range(m)]
	elif i % 4 == 1:
		mas[i][-1] = 1
	else:
		mas[i][0] = 1
output(mas)


(a, b) = [int(x) for x in input().split()]
for i in range(0, a):
	if i % 2 == 0:
		print(b * '#')
	if i % 2 != 0 and (i - 1) % 4 == 0:
		print((b - 1) * '.' + '#')
	if i % 2 != 0 and (i - 1) % 4 != 0:
		print('#' + (b - 1) * '.')


def drawOddLine(k):
	s = ''
	for i in range(k):
		s += '#'
	return s

def drawRightSide(k):
	s = ''
	for i in range(k - 1):
		s += '.'
	s += '#'
	return s

def drawLeftSide(k):
	s = '#'
	for i in range(k - 1):
		s += '.'
	return s
(n, m) = map(int, input().split())
right = drawRightSide(m)
left = drawLeftSide(m)
odd = drawOddLine(m)
for i in range(n):
	if i % 2 == 0:
		print(odd)
	elif i % 4 == 3:
		print(left)
	else:
		print(right)


(line, number) = map(int, input().split(' '))
l = -1
g = -1
for i in range(line):
	if l == -1:
		print('#' * number)
		l *= -1
	else:
		if g == -1:
			print('.' * (number - 1) + '#')
			g *= -1
		else:
			print('#' + '.' * (number - 1))
			g *= -1
		l *= -1


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, m) = invr()
snake = []
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	elif i % 4 == 3:
		print('#' + '.' * (m - 1))


var = input()
(n, m) = var.split()
n = int(n)
m = int(m)
hashtag_line = ''
dot_line = ''
right = True
for i in range(m - 1):
	hashtag_line += '#'
	dot_line += '.'
hashtag_line += '#'
for i in range(n):
	if i % 2 == 0:
		print(hashtag_line)
	elif right == True:
		print(dot_line, end='')
		print('#')
		right = False
	else:
		print('#', end='')
		print(dot_line)
		right = True


(y, x) = [int(x) for x in input().split(' ')]
a = []
for i in range(0, y, 1):
	a += [list('#' * x)] if i % 2 == 0 else [list('.' * x)]
for i in range(1, y, 4):
	a[i][-1] = '#'
for i in range(3, y, 4):
	a[i][0] = '#'
for i in a:
	print(''.join(i))


number = list(map(int, input().split()))
n = number[0]
m = number[1]
flag = 1
flag2 = 1
for i in range(1, n + 1):
	if flag % 2 != 0:
		for j in range(0, m):
			print('#', end='')
		flag += 1
		print('')
	else:
		for j in range(0, m):
			if flag2 % 2 != 0 and j == m - 1:
				print('#', end='')
			elif flag2 % 2 == 0 and j == 0:
				print('#', end='')
			else:
				print('.', end='')
		flag += 1
		flag2 += 1
		print('')


a = input().split()
switch = True
for i in range(int(a[0])):
	if i % 2 == 0:
		print('#' * int(a[1]))
	elif switch:
		print('.' * (int(a[1]) - 1), end='')
		print('#')
		switch = False
	else:
		print('#', end='')
		print('.' * (int(a[1]) - 1))
		switch = True


(h, r) = map(int, input().split())
f = 1
for i in range(h):
	if i % 2 == 0:
		print('#' * r)
	elif f == 1:
		print('.' * (r - 1) + '#')
		f = 0
	else:
		print('#' + '.' * (r - 1))
		f = 1


(n1, n2) = map(int, input().split())
s1 = ''
s2 = ''
count = 0
for i in range(n2):
	s1 += '#'
	if i == n2 - 1:
		s2 += '#'
	else:
		s2 += '.'
for i in range(1, n1 + 1):
	if i % 2 == 1:
		print(s1)
	else:
		if count % 2 == 0:
			print(s2)
		else:
			print(s2[::-1])
		count += 1


(r, c) = [int(x) for x in input().split()]
for i in range(r):
	print(['#' * c, '.' * (c - 1) + '#', '#' * c, '#' + '.' * (c - 1)][i % 4])


import math
l = [int(x) for x in input().split()]
(n, m) = l
table = []
for i in range(n):
	if i % 2 == 0:
		table.append(['#'] * m)
		table[i] = ''.join(table[i])
	elif math.floor(i / 2) % 2 == 0:
		table.append(['.'] * (m - 1) + ['#'])
		table[i] = ''.join(table[i])
	else:
		table.append(['#'] + ['.'] * (m - 1))
		table[i] = ''.join(table[i])
for i in range(n):
	print(table[i])


x = input().split(' ')
l = int(x[0])
w = int(x[1])
c = '.' * (w - 1) + '#'
v = '#' + '.' * (w - 1)
f = 0
for i in range(l):
	if i % 2 == 0:
		print('#' * w)
	elif i % 2 == 1:
		if f % 2 == 0:
			print(c)
			f += 1
		else:
			print(v)
			f += 1


(a, b) = map(int, input().split())
x = [[0 for i in range(b)] for j in range(a)]
for i in range(a):
	for j in range(b):
		if i % 2 == 0:
			x[i][j] = '#'
		if i % 2 == 1:
			x[i][j] = '.'
			if i // 2 % 2 == 0:
				x[i][b - 1] = '#'
			if i // 2 % 2 == 1:
				x[i][0] = '#'
for i in range(a):
	print(''.join(x[i]))


(n, m) = map(int, input().split())
for i in range(n):
	if i % 4 == 0 or i % 4 == 2:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1), '#', sep='')
	elif i % 4 == 3:
		print('#', '.' * (m - 1), sep='')


(n, m) = list(map(int, input().split()))
left = False
full = True
for i in range(n):
	if full == True:
		print('#' * m)
		full = False
	else:
		if left == True:
			print('#' + '.' * (m - 1))
			left = False
		else:
			print('.' * (m - 1) + '#')
			left = True
		full = True


(n, m) = map(int, input().split())
toggle = True
toggle1 = True
for i in range(n):
	if toggle:
		print('#' * m)
		toggle = False
	else:
		if toggle1:
			print('.' * (m - 1) + '#')
			toggle1 = False
		else:
			print('#' + '.' * (m - 1))
			toggle1 = True
		toggle = True


(a, b) = (int(i) for i in input().split())
for i in range(a):
	ch = ''
	if i % 2 == 0:
		for i in range(b):
			ch = ch + '#'
		print(ch)
	elif (i + 1) % 4 == 0:
		ch = '#'
		for j in range(b - 1):
			ch = ch + '.'
		print(ch)
	else:
		for j in range(b - 1):
			ch = ch + '.'
		ch = ch + '#'
		print(ch)


str = input()
s = str.split(' ')
n = int(s[0])
m = int(s[1])
c = int(0)
while c < n:
	if c % 2 == 0:
		s = '#'
		for i in range(m - 1):
			s = s + '#'
		print(s)
	else:
		if c % 4 == 3:
			s = '#'
			for i in range(0, m - 1):
				s = s + '.'
		else:
			s = '.'
			for i in range(m - 2):
				s = s + '.'
			s = s + '#'
		print(s)
	c = c + 1


(n, m) = [int(x) for x in input().split()]
r = 1
l = 0
flg = 0
for i in range(n):
	flg = 0
	for j in range(m):
		if i % 2 != 0:
			if r == 1:
				if j == m - 1 and flg == 0:
					print('#')
					r = 0
					l = 1
					flg = 1
					continue
				elif j == m - 1:
					print('.')
				else:
					print('.', end='')
			elif l == 1:
				if l == 1 and flg == 0:
					print('#', end='')
					l = 0
					r = 1
					flg = 1
					continue
				elif j == m - 1:
					print('.')
				else:
					print('.', end='')
		elif j == m - 1:
			print('#')
		else:
			print('#', end='')


vector = [int(i) for i in str(input()).split()]
leftRight = 1
for i in range(vector[0]):
	if i % 2 == 0:
		print('#' * vector[1])
	elif leftRight == 1:
		print('.' * (vector[1] - 1) + '#')
		leftRight = 0
	else:
		print('#' + '.' * (vector[1] - 1))
		leftRight = 1


nmStr = input()
n = int(nmStr.split()[0])
m = int(nmStr.split()[1])
i = 1
while i <= n:
	if i % 2 == 1:
		line = ''.join(['#'] * m)
		print(line)
	else:
		ir = i // 2
		if ir % 2 == 1:
			line = ''.join(['.'] * (m - 1) + ['#'])
			print(line)
		else:
			line = ''.join(['#'] + ['.'] * (m - 1))
			print(line)
	i = i + 1


s = input().split()
a = int(s[0])
b = int(s[1])
mat = []
sat = []
point = 0
for i in range(a):
	if i % 2 == 0:
		for j in range(b):
			sat.append('#')
		mat.append(sat)
		sat = []
	elif i % 2 == 1:
		if point % 2 == 0:
			point += 1
			for l in range(b - 1):
				sat.append('.')
			sat.append('#')
			mat.append(sat)
			sat = []
		elif point % 2 == 1:
			point += 1
			sat.append('#')
			for l in range(b - 1):
				sat.append('.')
			mat.append(sat)
			sat = []
for i in mat:
	for j in i:
		print(j, end='')
	print()


(n, t) = map(int, input().split())

def fox(n, t):
	for i in range(1, n + 1):
		if i % 2 == 1:
			print('#' * t)
		elif i % 4 == 0:
			print('#' + '.' * (t - 1))
		else:
			print('.' * (t - 1) + '#')
fox(n, t)


def snake(ans, n, x):
	if len(ans) == n:
		return ans + '#'
	else:
		return snake(ans + x, n, x)
a = [int(x) for x in input().split()]
memo1 = snake('', a[1] - 1, '#')
memo = snake('', a[1] - 1, '.')
for x in range(a[0]):
	if x % 2 == 0:
		print(memo1)
	else:
		print(memo)
		memo = memo[::-1]


(n, m) = map(int, input().split())
i = 1
while i <= n:
	if i % 4 == 1 or i % 4 == 3:
		print('#' * m)
	elif i % 4 == 2:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))
	i += 1


inp = input()
(n, m) = [int(x) for x in inp.split()]
snake = ['#' * m]
for i in range(int(n / 2)):
	if i % 2 == 0:
		snake.append('.' * (m - 1) + '#')
	else:
		snake.append('#' + '.' * (m - 1))
	snake.append('#' * m)
for i in range(n):
	print(snake[i])


(n, m) = map(int, input().split())
k = n
co = False
while n > 0:
	for i in range(m):
		print('#', end='')
	print('')
	n -= 1
	if n > 0:
		if co:
			print('#', end='')
			for i in range(1, m):
				print('.', end='')
			print('')
			co = False
		else:
			for i in range(1, m):
				print('.', end='')
			print('#', end='')
			print('')
			co = True
		n -= 1


(n, m) = input().split()
n = int(n)
m = int(m)
o = 0
for i in range(n):
	if int(i % 2) == 0:
		a = ''
		for j in range(m):
			a = a + '#'
		print(a)
	else:
		o = o + 1
		b = ''
		for j in range(m):
			if int(o % 2) != 0 and j == m - 1:
				b = b + '#'
			elif int(o % 2) == 0 and j == 0:
				b = b + '#'
			else:
				b = b + '.'
		print(b)


(n, m) = map(int, input().split())
for i in range(n):
	if i % 2 == 0:
		c = ''
		for i1 in range(m):
			c += '#'
		print(c)
	else:
		if (i + 1) % 2 == 0 and (i + 1) / 2 % 2 == 0:
			c = '#'
			for j in range(m - 1):
				c += '.'
		else:
			c = ''
			for j in range(m - 1):
				c += '.'
			c += '#'
		print(c)


(n, m) = map(int, input().split())
for x in range(1, n + 1):
	if x % 2 != 0:
		print(m * '#')
	elif x % 2 == 0 and x / 2 % 2 != 0:
		print((m - 1) * '.' + '#')
	else:
		print('#' + (m - 1) * '.')


(n, m) = map(int, input().split())
straight = '#' * m
right = '.' * (m - 1) + '#'
left = '#' + '.' * (m - 1)
for i in range(1, n + 1):
	if i % 2 == 1:
		print(straight)
	elif i % 4 == 2:
		print(right)
	elif i % 4 == 0:
		print(left)


data = input().split()
(N, M) = (int(data[0]), int(data[1]))
one_hash_count = 1
snake = []
for i in range(0, N):
	if (i + 1) % 2 == 0 and one_hash_count % 2 != 0:
		snake.append(['.' * (M - 1) + '#'])
		one_hash_count += 1
		continue
	elif (i + 1) % 2 == 0 and one_hash_count % 2 == 0:
		snake.append(['#' + '.' * (M - 1)])
		one_hash_count += 1
		continue
	elif (i + 1) % 2 != 0:
		snake.append(['#' * M])
		continue
print('\n'.join((' '.join(map(str, line)) for line in snake)))


num = input()
arr = []
count = 0
for i in range(0, len(num)):
	if num[i] == ' ':
		arr.append(int(num[count:i]))
		count = i + 1
	elif i == len(num) - 1:
		arr.append(int(num[count:len(num)]))
n = arr[0]
m = arr[1]
movement = ''
right_side = ''
left_side = ''
x = 1
while x <= m:
	movement += '#'
	if x == 1:
		left_side += '#'
		right_side += '.'
	elif x == m:
		right_side += '#'
		left_side += '.'
	else:
		right_side += '.'
		left_side += '.'
	x += 1
w = 1
right = True
while w <= n:
	if w % 2 == 1:
		print(movement)
	elif right is True:
		print(right_side)
		right = False
	else:
		print(left_side)
		right = True
	w += 1


data = input()
(line, characters) = data.split(' ')
line = int(line)
characters = int(characters)
counter = 1
subcounter = 1
while line > 0:
	if counter % 2 != 0:
		print('#' * characters)
		counter = counter + 1
	elif counter % 2 == 0:
		if subcounter % 2 != 0:
			print('.' * (characters - 1) + '#')
			subcounter = subcounter + 1
		elif subcounter % 2 == 0:
			print('#' + '.' * (characters - 1))
			subcounter = subcounter + 1
		counter = counter + 1
	line = line - 1


(a, b) = map(int, input().split())
s = []
for i in range(a):
	if i % 2 == 0:
		s.append(['#'] * b)
	elif i // 2 % 2 == 0:
		s.append(['.'] * (b - 1) + ['#'])
	else:
		s.append(['#'] + ['.'] * (b - 1))
for i in s:
	for x in i:
		print(x, end='')
	print()


def main():
	[n, m] = [int(_) for _ in input().split()]
	for i in range(n):
		if i % 2 == 0:
			print(''.join(['#'] * m))
		else:
			cells = ''.join(['.'] * (m - 1))
			print(cells + '#' if i % 4 == 1 else '#' + cells)
main()


(n, m) = list(map(int, input().split(' ')))
f = []
for i in range(0, n, 2):
	f.append(['#'] * m)
	if i + 1 < n:
		f.append(['.'] * m)
p = m - 1
for i in range(1, n, 2):
	f[i][p] = '#'
	p = 0 if p == m - 1 else m - 1
for r in f:
	print(''.join(r))


(n, m) = map(int, input().split())
arr = [['.' for i in range(m)] for i in range(n + 1)]
flag = True
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			arr[i][j] = '#'
	elif i % 2 != 0:
		if flag:
			arr[i][-1] = '#'
			flag = False
		else:
			arr[i][0] = '#'
			flag = True
for i in range(n):
	for j in range(m):
		print(arr[i][j], end='')
	print()


(n, m) = list(map(int, input().split()))
start = True
for i in range(1, n + 1):
	if i % 2 == 1:
		for j in range(m):
			print('#', end='')
		print()
	elif start:
		for j in range(m - 1):
			print('.', end='')
		print('#')
		start = False
	else:
		print('#', end='')
		for j in range(m - 1):
			print('.', end='')
		print()
		start = True


s = [int(j) for j in input().split()]
sa = '#' * s[1]
l = '#' * s[1]
l = l.replace('#', '.', s[1] - 1)
for i in range(s[0]):
	if (i + 1) % 4 == 0:
		print(l[::-1])
	elif i % 2 == 0:
		print(sa)
	else:
		print(l)


import sys
(n, m) = map(int, input().split())
snake = []
for i in range(1, n + 1):
	row = []
	if i % 4 == 0:
		row.append('#')
		for __ in range(m - 1):
			row.append('.')
	elif i % 2 == 0:
		for __ in range(m - 1):
			row.append('.')
		row.append('#')
	else:
		for __ in range(m):
			row.append('#')
	snake.append(row)
for x in snake:
	print(''.join(x))


a = list(map(int, input().split()))
odd = '#' * a[1]
even = '.' * (a[1] - 1) + '#'
for i in range(a[0]):
	if i % 2 == 0:
		print(odd)
	else:
		print(even)
		even = even[::-1]


a = [int(x) for x in input().split()]
for i in range(1, a[0] + 1):
	for j in range(1, a[1] + 1):
		if i % 2 != 0 or (i % 2 == 0 and i % 4 != 0 and (j == a[1])):
			print('#', end='')
		elif i % 4 == 0 and j == 1:
			print('#', end='')
		else:
			print('.', end='')
	print()


(X, Y) = input().split()
x = int(X)
y = int(Y)
for r in range(1, x + 1):
	if r % 2 != 0:
		for c in range(y):
			print('#', end='')
		print()
	if r % 2 == 0 and r // 2 % 2 != 0:
		for c in range(0, y):
			if c == y - 1:
				print('#', end='')
			else:
				print('.', end='')
		print()
	if r % 2 == 0 and r // 2 % 2 == 0:
		for c in range(0, y):
			if c == 0:
				print('#', end='')
			else:
				print('.', end='')
		print()


inputs = [int(x) for x in input().split(' ')]
n = inputs[0]
m = inputs[1]
output = ''
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			output += '#'
		elif i % 4 == 3:
			if j == 0:
				output += '#'
			else:
				output += '.'
		elif j == m - 1:
			output += '#'
		else:
			output += '.'
	output += '\n'
output = output[:-1]
print(output)


(n, m) = input().strip().split()
(n, m) = (int(n), int(m))
for j in range(1, n + 1):
	if j % 2 != 0:
		print(m * '#')
	elif j % 4 == 0:
		print('#' + (m - 1) * '.')
	else:
		print((m - 1) * '.' + '#')


import sys
(r, c) = [int(x) for x in sys.stdin.readline().split()]
for i in range(1, r + 1):
	if i % 2 == 1:
		print('#' * c)
	elif i % 4 == 2:
		print('.' * (c - 1) + '#')
	else:
		print('#' + '.' * (c - 1))


(n, m) = [int(x) for x in input().split(' ')]
m_side = 'right'
z = m - 1
drawing = []
for i in range(n):
	if i % 2 == 0:
		drawing.append('#' * m)
	elif m_side == 'right':
		drawing.append('.' * z + '#')
		m_side = 'left'
	else:
		drawing.append('#' + '.' * z)
		m_side = 'right'
for d in drawing:
	print(d)


(a, b) = [int(j) for j in input().split(' ')]
s = '#'
s_l = '#' * b
empty = '.' * (b - 1)
toggle = True
for i in range(a):
	if i % 2 == 0:
		print(s_l)
	else:
		if toggle:
			print(empty + s)
		else:
			print(s + empty)
		toggle = not toggle


def read_array():
	x = []
	x1 = []
	x = input()
	x = x.split(' ')
	for r in range(len(x)):
		x1.append(int(x[r]))
	return x1

def create_array(n, m):
	linha = []
	matrix = []
	a = True
	for j in range(n):
		for r in range(m):
			if j % 2 == 0:
				linha.append('#')
			elif a and r == m - 1 and (linha[0] != '#'):
				linha.append('#')
				a = not a
			elif not a and r == 0:
				linha.append('#')
				a = not a
			else:
				linha.append('.')
		matrix.append(linha)
		linha = []
	return matrix
x = read_array()
ar = create_array(x[0], x[1])
for vectors in ar:
	for v in vectors:
		print(v, end='')
	print('')


from sys import stdin
live = True
if not live:
	stdin = open('data.in', 'r')
(n, m) = list(map(int, stdin.readline().strip().split()))
full_line = ''.join(map(str, ['#'] * m))
first_char = ''.join(map(str, ['#'] + ['.'] * (m - 1)))
last_char = ''.join(map(str, ['.'] * (m - 1) + ['#']))
last = True
for it in range(n):
	if it % 2 == 0:
		print(full_line)
	elif last:
		last = False
		print(last_char)
	else:
		last = True
		print(first_char)
if not live:
	stdin.close()


(r, c) = map(int, input().split())
flag = False
for i in range(0, r):
	if i % 2 == 0:
		print('#' * c)
	elif flag == False:
		print('.' * (c - 1), end='')
		print('#')
		flag = True
	else:
		print('#', end='')
		print('.' * (c - 1))
		flag = False


(row, column) = map(int, input().split())
draw = []
counter = 0
for i in range(1, row + 1):
	word = ''
	if i % 2 == 1:
		word += '#' * column
	else:
		if counter % 2 == 0:
			word += '.' * (column - 1) + '#'
		else:
			word += '#' + '.' * (column - 1)
		counter += 1
	print(word)


import sys
(n, m) = map(int, sys.stdin.readline().split())
flag = 1
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif i % 2 == 0:
		flag = -flag
		if flag < 0:
			for k in range(m - 1):
				print('.', end='')
			print('#')
		if flag > 0:
			print('#', end='')
			print('.' * (m - 1))


def preps(m):
	s = '#' * m
	return s

def preps1(m):
	s = '.' * (m - 1) + '#'
	return s

def preps2(m):
	s = '#' + '.' * (m - 1)
	return s
[n, m] = list(map(int, input().split()))
(s, s1, s2) = (preps(m), preps1(m), preps2(m))
while n > 0:
	if n > 0:
		print(s)
		n -= 1
	if n > 0:
		print(s1)
		n -= 1
	if n > 0:
		print(s)
		n -= 1
	if n > 0:
		print(s2)
		n -= 1


(n, m) = list(map(int, input().split()))
l = [['.' for i in range(m)] for j in range(n)]
c = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			l[i][j] = '#'
	elif c % 2 == 0:
		l[i][m - 1] = '#'
		c += 1
	else:
		l[i][0] = '#'
		c += 1
for i in range(n):
	l[i] = ''.join(l[i])
for i in l:
	print(i)


(n, m) = list(map(int, input().split(' ')))
for s in range(n):
	print('#' * m if s % 2 == 0 else '.' * (m - 1) + '#' if s % 4 == 1 else '#' + '.' * (m - 1))


(a, b) = map(int, input().split())
i = 2
j = 2
while a:
	if i % 2 == 0:
		print(('#' + '') * b)
		i += 1
	elif j % 2 == 0:
		print(('.' + '') * (b - 1) + '#')
		i += 1
		j += 1
	else:
		print('#' + ('.' + '') * (b - 1))
		i += 1
		j += 1
	a -= 1


list1 = input().split()
list2 = [int(i) for i in list1]
n = list2[0]
m = list2[1]
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	elif i % 2 == 0:
		if i % 4 == 2:
			print('.' * (m - 1) + '#')
		elif i % 4 == 0:
			print('#' + '.' * (m - 1))


(n, m) = tuple(input().split(' '))
n = int(n)
m = int(m)
r = True
for x in range(n):
	if x % 2 == 1 and r:
		print('.' * (m - 1) + '#')
		r = False
	elif x % 2 == 1:
		print('#' + '.' * (m - 1))
		r = True
	else:
		print('#' * m)


(n, k) = (int(x) for x in input().split())
l = ['#' * k if i % 2 == 0 else ('#' if i % 4 == 3 else '') + '.' * (k - 1) + ('#' if i % 4 == 1 else '') for i in range(n)]
print('\n'.join(l))


(n, m) = map(int, input().split())
for i in range(1, n + 1):

	def fun(m):
		k = ''
		for j in range(m):
			k += '#'
		return k
	if i % 2 != 0:
		print(fun(m))
	elif i % 4 == 0:
		print('#' + val(m))
	else:
		print(val(m) + '#')

	def val(m):
		k = ''
		for j in range(m - 1):
			k += '.'
		return k


(n, m) = map(int, input().split())
s1 = '#' * m
s2 = '.' * (m - 1)
m1 = m - (m - 1)
x = 0
for r in range(n):
	if r % 2 == 0:
		print(s1)
	for c in range(m1):
		if r % 2 != 0 and x == 0:
			print(s2 + '#')
			x = x + 1
		elif r % 2 != 0 and x == 1:
			print('#' + s2)
			x = x - 1


(n, m) = input().split()
whileloop_count = 1
dotline = 0
k = int(m) - 1
while whileloop_count <= int(n):
	if whileloop_count % 2 != 0:
		print('#' * int(m))
	elif whileloop_count % 2 == 0 and dotline % 2 == 0:
		print('.' * k + '#')
		dotline += 1
	elif whileloop_count % 2 == 0 and dotline % 2 != 0:
		print('#' + '.' * k)
		dotline += 1
	whileloop_count += 1


n = [int(s) for s in input().split()]
mang = [[None for cot in range(n[1])] for dong in range(n[0])]
dem = 0
for i in range(n[0]):
	for j in range(n[1]):
		if i % 2 == 0:
			mang[i][j] = '#'
		else:
			if dem % 2 != 0:
				if j == 0:
					mang[i][j] = '#'
					continue
			elif j == n[1] - 1:
				mang[i][j] = '#'
				continue
			mang[i][j] = '.'
	if i % 2 != 0:
		dem += 1
for i in range(n[0]):
	print(''.join(mang[i]))


(n, m) = list(map(int, input().split()))
x = 0
y = 0
s = 0
while s != n:
	if x == 0:
		print(''.join(['#'] * m))
		x += 1
		s += 1
	elif y == 0:
		print(''.join(['.'] * (m - 1)) + '#')
		s += 1
		x = 0
		y = 1
	else:
		print('#' + ''.join(['.'] * (m - 1)))
		s += 1
		x = 0
		y = 0


(n, m) = map(int, input().split())
a = '#' * m
b = '.' * (m - 1) + '#'
c = '#' + '.' * (m - 1)
for i in range(1, n + 1):
	if i % 2 != 0:
		print(a)
	elif i / 2 % 2 != 0:
		print(b)
	elif i / 2 % 2 == 0:
		print(c)


(n, m) = map(int, input().split())
p = ''
t = ''
s = ''
k = 1
for i in range(m):
	p = p + '#'
	if i < m - 1:
		t = t + '.'
	else:
		t = t + '#'
	if i == 0:
		s = s + '#'
	else:
		s = s + '.'
for i in range(1, n + 1):
	if i % 2 != 0:
		print(p)
	elif k == 1:
		print(t)
		k = 2
	else:
		print(s)
		k = 1


(A, B) = map(int, input().split())
for x in range(1, A + 1):
	if x % 4 == 0:
		print('#' + '.' * (B - 1))
	elif x % 2 == 0:
		print('.' * (B - 1) + '#')
	else:
		print('#' * B)


(n, m) = [int(x) for x in input().split()]
alt = -1
for x in range(0, n):
	if x % 2 == 0:
		for y in range(0, m):
			print('#', end='')
		print('')
	if x % 2 == 1:
		alt = alt * -1
		if alt == 1:
			for a in range(1, m):
				print('.', end='')
			print('#')
		else:
			print('#', end='')
			for a in range(1, m):
				print('.', end='')
			print('')


arr = input().split()
n = int(arr[0])
m = int(arr[1])
sharp = '#'
dot = '.'
right = True
left = False
for i in range(1, n + 1):
	if i % 2 == 1:
		print(sharp * m)
	elif right:
		print(dot * (m - 1) + sharp)
		right = False
		left = True
	else:
		print(sharp + dot * (m - 1))
		right = True
		left = False


(n, m) = list(map(int, input().split()))
a = [['.' for col in range(m)] for row in range(n)]
cur = 'L'
for i in range(0, n, 2):
	if cur == 'L':
		for j in range(m):
			a[i][j] = '#'
		cur = 'R'
		if i < n - 1:
			a[i + 1][m - 1] = '#'
	elif cur == 'R':
		for j in range(m - 1, -1, -1):
			a[i][j] = '#'
		cur = 'L'
		if i < n - 1:
			a[i + 1][0] = '#'
for row in a:
	print(''.join(row))


(a, b) = map(int, input().split())
t = a // 2
p = a - t - 1
if p == 1:
	even1num = 1
else:
	even1num = p // 2 + 1
	even2num = p - even1num
odd = '#' * b + '\n'
even1 = '.' * (b - 1) + '#' + '\n'
even2 = '#' + '.' * (b - 1) + '\n'
result = ''
for i in range(a - 1):
	if i % 2 == 0:
		result += odd
	else:
		if i % 4 == 1:
			result += even1
		if i % 4 == 3:
			result += even2
result = result + '#' * b
print(result)


(n, m) = map(int, input().split())
dp = [['#' for _ in range(m)] for _ in range(n)]
for i in range(1, n, 4):
	ans = []
	for j in range(m - 1):
		ans.append('.')
	ans.append('#')
	dp[i] = ans
for i in range(3, n, 4):
	ans = []
	ans.append('#')
	for j in range(m - 1):
		ans.append('.')
	dp[i] = ans
for i in range(n):
	for j in range(m):
		print(dp[i][j], end='')
	print()


(n, m) = map(int, input().split(' '))
snakeBody = '#'
snakeBodies = snakeBody * m
emptyCells = '.' * (m - 1)
isRight = True
for row in range(n):
	if int(row % 2) == 0:
		print(snakeBodies)
	else:
		if isRight:
			print(emptyCells + snakeBody)
		else:
			print(snakeBody + emptyCells)
		isRight = not isRight


(n, m) = [int(x) for x in input().split()]
for i in range(n):
	if i % 2 and int((i - 1) / 2) % 2:
		print('#' + '.' * (m - 1))
	elif i % 2:
		print('.' * (m - 1) + '#')
	else:
		print('#' * m)


Choose = True
Right = True
(n, m) = map(int, input().split())
for i in range(n):
	if Choose:
		print(m * '#')
		Choose = False
	else:
		Choose = True
		if Right:
			print((m - 1) * '.', end='')
			print('#')
			Right = False
		else:
			Right = True
			print('#', end='')
			print((m - 1) * '.')


a = list(map(int, input().split(' ')))
for k in range(a[0]):
	if (k + 1) % 2 == 0 and (k + 1) % 4 == 0:
		print('#' + '.' * (a[1] - 1))
	elif (k + 1) % 2 == 0 and (k + 1) % 4 != 0:
		print('.' * (a[1] - 1) + '#')
	else:
		print('#' * a[1])


(x, y) = input().strip('\n\r\t ').split(' ')
x = int(x)
y = int(y)
st = 0
for i in range(0, x):
	if st == 0:
		print('#' * y)
		st = 1
	elif st == 1:
		print('.' * (y - 1) + '#')
		st = 2
	elif st == 2:
		print('#' * y)
		st = 3
	elif st == 3:
		print('#' + '.' * (y - 1))
		st = 0


(n, s) = map(int, input().split())
while n > 0:
	for j in range(s):
		print('#', end='')
	print()
	n = n - 1
	if n > 0:
		for j in range(s - 1):
			print('.', end='')
		print('#')
	n = n - 1
	if n > 0:
		for j in range(s):
			print('#', end='')
		print()
	n = n - 1
	if n > 0:
		print('#', end='')
		for j in range(s - 1):
			print('.', end='')
		print()
	n = n - 1


z = input().split()
for a in range(1, int(z[0]) + 1):
	if a % 2 == 1:
		print('#' * int(z[1]))
	if a % 4 == 0:
		print('#' + '.' * (int(z[1]) - 1))
	elif a % 2 == 0:
		print('.' * (int(z[1]) - 1) + '#')


while True:
	(n, m) = map(int, input().split(' '))
	if n >= 3 and n <= 50 and (n % 2 != 0) and (m >= 3) and (m <= 50):
		break
ch1 = m * '#'
ch2 = (m - 1) * '.' + '#'
ch3 = '#' + (m - 1) * '.'
for i in range(n):
	if (i + 1) % 2 != 0:
		print(ch1)
	elif (i + 1) % 4 == 0:
		print(ch3)
	else:
		print(ch2)


def parse(st):
	return [int(x) for x in st.split()]

def solve(n, m):
	whole = '#' * m
	right = '.' * (m - 1) + '#'
	left = '#' + '.' * (m - 1)
	for i in range(n):
		if i % 4 == 1:
			print(right)
		elif i % 4 == 3:
			print(left)
		else:
			print(whole)
(n, m) = parse(input())
solve(n, m)


(row, col) = input().split(' ')
x = 1
col = int(col)
col_em = col - 1
turn = 0
while x <= int(row):
	if x % 2 == 0:
		if turn == 0:
			print('.' * col_em + '#')
			turn = 1
		elif turn == 1:
			print('#' + '.' * col_em)
			turn = 0
	else:
		print('#' * col)
	x += 1


(a, b) = map(int, input().split())
c = '.' * (b - 1)
d = '#'
e = '#' * b
for x in range(a):
	if x % 2 == 0:
		print(e)
	else:
		print('{}{}'.format(c, d))
		(c, d) = (d, c)


(n, m) = map(int, input().split())
tab = []
hashes = ''
dots = ''
for i in range(m):
	hashes += '#'
	dots += '.'
for i in range(n // 2):
	tab.append(list(dots))
for i in range(0, n // 2, 2):
	tab[i][-1] = '#'
for i in range(1, n // 2, 2):
	tab[i][0] = '#'
for i in range(0, n + 1, 2):
	tab.insert(i, list(hashes))
for i in range(0, n):
	print(''.join(tab[i]))


(n, m) = [int(s) for s in input().split()]
tmp = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
print('\n'.join([tmp[i % 4] for i in range(n)]))


(n, m) = list(map(int, input().split(' ')))
switch = True
string = ''
for i in range((n - 1) // 2):
	string += '#' * m
	string += '\n'
	if switch:
		string += '.' * (m - 1) + '#'
	else:
		string += '#' + '.' * (m - 1)
	switch = not switch
	string += '\n'
string += '#' * m
print(string)


xy = input()
(y, x) = xy.split()
y = int(y)
x = int(x)
i = 0
while i <= y:
	i += 1
	if i <= y:
		print('#' * x)
	i += 1
	if i <= y:
		print('.' * (x - 1) + '#')
	i += 1
	if i <= y:
		print('#' * x)
	i += 1
	if i <= y:
		print('#' + '.' * (x - 1))


(length, width) = [int(x) for x in input().split()]
for x in range(length // 4):
	print('#' * width)
	print('.' * (width - 1) + '#')
	print('#' * width)
	print('#' + '.' * (width - 1))
if length % 4 == 1:
	print('#' * width)
elif length % 4 == 3:
	print('#' * width)
	print('.' * (width - 1) + '#')
	print('#' * width)


(a, b) = map(int, input().split())
z = '#' * b
q = '.' * (b - 1) + '#'
for i in range(1, a + 1):
	if i % 2 != 0:
		print(z)
	elif i % 4 == 0:
		print(q[::-1])
	elif i % 2 == 0:
		print(q)


(n, m) = list(map(int, input().split()))
x = [1 + i for i in range(0, n, 4)]

def xprint(value):
	print(value, end='')
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			xprint('#')
		print()
	elif i in x:
		for j in range(m - 1):
			xprint('.')
		xprint('#')
		print()
	else:
		xprint('#')
		for j in range(m - 1):
			xprint('.')
		print()


(m, n) = map(int, input().split())
modr = 0
for x in range(0, m):
	if x % 2 != 0:
		modr = n - modr - 1
	for y in range(0, n):
		if x % 2 == 0:
			print('#', end='')
		else:
			print('.' if y != modr else '#', end='')
	print('')


import os, sys, atexit
from io import BytesIO, StringIO
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
(n, m) = map(int, input().split())
for i in range(n):
	for j in range(m):
		print('#', end='') if i % 2 == 0 else print('#', end='') if i % 4 == 1 and j == m - 1 else print('.', end='') if i % 4 == 1 else print('#', end='') if j == 0 else print('.', end='')
	print()


(n, m) = map(int, input().split())
one_hash_count = 1
snake = []
for i in range(1, n + 1):
	if i % 2 != 0:
		snake.append(['#' * m])
	elif i % 2 == 0 and one_hash_count % 2 != 0:
		snake.append(['.' * (m - 1) + '#'])
		one_hash_count += 1
		continue
	elif i % 2 == 0 and one_hash_count % 2 == 0:
		snake.append(['#' + '.' * (m - 1)])
		one_hash_count += 1
		continue
for i in snake:
	print('\n'.join(i))


(mp, fl) = '. #'.split()

def sn(n, m):
	r = (m - 1) * mp + fl
	l = r[::-1]
	b = m * fl
	for x in range(n):
		if not x % 2:
			yield b
		elif not (x - 1) % 4:
			yield r
		else:
			yield l
(n, m) = [int(x) for x in input().split()]
for x in sn(n, m):
	print(x)


(rows, cell) = input().split()
first_row = '#' * int(cell)
second_row = '.' * (int(cell) - 1) + '#'
third_row = '#' * int(cell)
fourth_row = '#' + '.' * (int(cell) - 1)
arr_row = [first_row, second_row, third_row, fourth_row]
i = 0
num = 0
while i < int(rows):
	print(arr_row[i])
	i += 1
	arr_row.append(arr_row[num])
	num += 1


(n, m) = map(int, input().split())
ar = []
for i in range(1, n + 1):
	if i % 2 != 0:
		tmp = '#' * m
	elif i % 4 == 0:
		tmp = '#' + '.' * (m - 1)
	else:
		tmp = '.' * (m - 1) + '#'
	ar.append(tmp)
for i in ar:
	print(i)


(n, m) = list(map(int, input().split()))
s = ''
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			s += '#'
	else:
		if i in range(3, n, 4):
			s += '#'
			for k in range(m - 1):
				s += '.'
		if i in range(1, n, 4):
			for l in range(m - 1):
				s += '.'
			s += '#'
	print(s)
	s = ''


empty = '.'
snake = '#'
(m, n) = map(int, input().split())
count = 0
for i in range(m):
	if i % 2 != 0 and count % 2 == 0:
		print(empty * (n - 1) + snake)
		count += 1
	elif i % 2 != 0 and count % 2 != 0:
		print(snake + empty * (n - 1))
		count += 1
	else:
		print(snake * n)


(n, m) = [int(x) for x in input().split()]
f = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif f:
		print('.' * (m - 1), '#', sep='')
		f = False
	else:
		print('#', '.' * (m - 1), sep='')
		f = True


(n, m) = map(int, input().split())
t = 0
while t < n:
	if t % 4 == 0:
		snake = []
		for i in range(m):
			snake.append('#')
		output = ''.join(snake)
		print(output)
	if t % 4 == 1:
		snake = []
		for i in range(m):
			snake.append('.')
		snake[m - 1] = '#'
		output = ''.join(snake)
		print(output)
	if t % 4 == 2:
		snake = []
		for i in range(m):
			snake.append('#')
		output = ''.join(snake)
		print(output)
	if t % 4 == 3:
		snake = []
		for i in range(m):
			snake.append('.')
		snake[0] = '#'
		output = ''.join(snake)
		print(output)
	t = t + 1


a = input()
b = a.split()
table = []
for x in range(int(b[0])):
	if x % 2 == 0:
		table.append(['#'] * int(b[1]))
	elif x % 4 == 1:
		table.extend([['.' * (int(b[1]) - 1), '#']])
	else:
		table.extend([['#', '.' * (int(b[1]) - 1)]])
for row in table:
	print(''.join(row))


(n, m) = map(int, input().split())
a = ''
b = ''
c = ''
d = '#'
for i in range(m):
	a = a + '#'
	c = c + '#'
	if i != m - 2:
		b = b + '.'
		d = d + '.'
b = b + '#'
h = 0
while h != n:
	if h != n:
		print(a)
		h = h + 1
	if h != n:
		print(b)
		h = h + 1
	if h != n:
		print(c)
		h = h + 1
	if h != n:
		print(d)
		h = h + 1


var = [int(x) for x in input().split()]
(n, m) = (var[0], var[1])
res = '.' * (m - 1) + '#'
count = 1
for i in range(n):
	if n % 2 == 1:
		for j in range(m):
			print('#', end='')
	elif n % 2 == 0:
		if count % 2 == 1:
			print('\n', res)
		elif count % 2 == 0:
			print('\n', res[::-1])
		count = count + 1
	n = n - 1


n_m = input().split()
n = int(n_m[0])
m = int(n_m[1])
d = True
for i in range(n):
	a = True
	if i % 2 == 0:
		for p in range(m):
			print('#', end='')
		print()
	if i % 2 != 0 and d == True and (a == True):
		for p in range(m - 1):
			print('.', end='')
		print('#')
		d = False
		a = False
	if i % 2 != 0 and d == False and (a == True):
		print('#', end='')
		for p in range(m - 1):
			print('.', end='')
		print()
		d = True
		a = False


(n, m) = list(map(int, input().split(' ')))
field = ''
k = 0
for i in range(n):
	if i % 2 == 0:
		field += '#' * m + '\n'
	elif k == 0:
		k = 1
		field += '.' * (m - 1) + '#' + '\n'
	else:
		k = 0
		field += '#' + '.' * (m - 1) + '\n'
print(field.strip())


(n, m) = input().split(' ')
(n, m) = (int(n), int(m))
output = []
turn = False
right = True
for i in range(n):
	if turn:
		if right:
			output.append('.' * (m - 1) + '#')
			right = False
		else:
			output.append('#' + '.' * (m - 1))
			right = True
		turn = False
	else:
		output.append('#' * m)
		turn = True
for i in output:
	print(i)


(n, m) = [int(i) for i in input().split()]
a = []
for i in range(n):
	a.append(['.'] * m)
for i in range(m):
	for j in range(n):
		if i == 0 and (j + 1) % 4 == 0 or j % 2 == 0 or (i == m - 1 and (j - 1) % 4 == 0):
			a[j][i] = '#'
for i in range(n):
	for j in range(m):
		print(a[i][j], end='')
	print()


(N, M) = map(int, input().split())
snake = []
for i in range(0, N):
	S = ''
	for j in range(0, M):
		if i % 2 == 0:
			S = S + '#'
		elif i % 4 == 1 and j == M - 1:
			S = S + '#'
		elif i % 4 == 3 and j == 0:
			S = S + '#'
		else:
			S = S + '.'
	print(S)


n = input().split(' ')
c = 0
for i in range(int(n[0])):
	if i % 2 == 0:
		print('#' * int(n[1]))
	elif c == 0:
		titik = int(n[1]) - 1
		pagar = int(n[1]) - titik
		print('.' * titik + '#' * pagar)
		c += 1
	else:
		print('#' * pagar + '.' * titik)
		c = 0


def solve(n, m):
	grid = [['.'] * m for _ in range(n)]
	for i in range(0, n, 2):
		grid[i] = '#' * m
	for i in range(1, n, 2):
		if i % 4 == 1:
			grid[i][-1] = '#'
		elif i % 4 == 3:
			grid[i][0] = '#'
	return '\n'.join((''.join(xs) for xs in grid))

def tf_to_message(tf):
	if tf:
		return 'I become the guy.'
	else:
		return 'Oh, my keyboard!'

def main():
	[n, m] = [int(i) for i in input().strip().split()]
	assert n % 2 == 1
	result = solve(n, m)
	print(result)
main()


import re
numbers = re.findall('\\d+', input(''))
n = int(numbers[0])
m = int(numbers[1])
for i in range(n):
	if (i + 1) % 4 == 0:
		print('#' + '.' * (m - 1))
	elif (i + 1) % 2 == 0:
		print('.' * (m - 1) + '#')
	else:
		print('#' * m)


s = input().split(' ')
x = int(s[0])
y = int(s[1])
c = 0
k = 0
for i in range(x):
	if c % 2 == 0:
		print('#' * y)
	else:
		if k % 2 == 0:
			print('.' * (y - 1) + '#')
		else:
			print('#' + '.' * (y - 1))
		k += 1
	c += 1


def Main():
	string = input().split(' ')
	n = int(string[0])
	m = int(string[1])
	mark = True
	for i in range(n):
		line = ''
		for j in range(m):
			if i % 2 == 0:
				line = line + '#'
			else:
				line = line + '.'
		if mark is True and i % 2 != 0:
			line = list(line)
			line[m - 1] = '#'
			line = ''.join(line)
			mark = False
		elif mark is False and i % 2 != 0:
			line = list(line)
			line[0] = '#'
			line = ''.join(line)
			mark = True
		print(line)
Main()


(n, m) = map(int, input().split())
body = '#' * m
right = '.' * (m - 1) + '#'
left = '#' + '.' * (m - 1)
snake = [body, right, body]
if n == 3:
	for i in snake:
		print(i)
else:
	for i in range(3, n):
		if snake[i - 1] == right or snake[i - 1] == left:
			snake.append(body)
		elif snake[i - 2] == right:
			snake.append(left)
		elif snake[i - 2] == left:
			snake.append(right)
	for i in snake:
		print(i)


(n, m) = map(int, input().split())
leftOrRight = True
for i in range(1, n + 1):
	string = ''
	if i % 2 == 1:
		for t in range(1, m + 1):
			string += '#'
	elif leftOrRight:
		for t in range(1, m + 1):
			if t == m:
				string += '#'
			else:
				string += '.'
		leftOrRight = False
	else:
		for t in range(1, m + 1):
			if t == 1:
				string += '#'
			else:
				string += '.'
		leftOrRight = True
	print(string)


(a, b) = list(map(int, input().split()))
s = a // 2
for i in range(s):
	if i % 2 == 0:
		print('#' * b)
		print('.' * (b - 1) + '#')
	else:
		print('#' * b)
		print('#' + '.' * (b - 1))
print('#' * b)


(a, b) = list(map(int, input().split()))
s1 = '#' * b
s2 = '.' * (b - 1) + '#'
for i in range(1, a + 1, 1):
	if i % 4 == 0:
		print(s2[::-1])
	elif i % 2 != 0:
		print(s1)
	elif i % 2 == 0:
		print(s2)


a = list(map(int, input().split(' ')))
b = '#'
c = ''
for i in range(1, a[1]):
	b += '#'
	c += '.'
for i in range(0, a[0]):
	if i % 4 == 1:
		print(c + '#')
	elif i % 4 == 3:
		print('#' + c)
	else:
		print(b)


(n, m) = map(int, input().split())
s = '#' * m
t = '.' * (m - 1) + '#'
h = '#' + '.' * (m - 1)
while n > 0:
	print(s)
	n -= 1
	if n > 0:
		print(t)
		n -= 1
	if n > 0:
		print(s)
		n -= 1
	if n > 0:
		print(h)
		n -= 1


(n, m) = map(int, input().split())
a1 = ''
a2 = ''
for i in range(m - 1):
	a1 = a1 + '#'
	a2 = a2 + '.'
for i in range(1, n + 1):
	if i % 4 == 1 or i % 4 == 3:
		print(a1 + '#')
	elif i % 4 == 2:
		print(a2 + '#')
	else:
		print('#' + a2)


nm = tuple(map(int, input().split()))
c = 1
for i in range(nm[0]):
	if i % 2 == 0:
		for j in range(nm[1]):
			print('#', end='')
	else:
		if c % 2 == 0:
			print('#', end='')
		for k in range(nm[1] - 1):
			print('.', end='')
		if c % 2 != 0:
			print('#', end='')
		c += 1
	print()


(N, m) = map(int, input().split())
for i in range(1, N + 1):
	if i & 1:
		print('#' * m)
	elif i % 4 == 2:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


import math
(n, m) = map(int, input().split())
rows = int(math.ceil(n / 2))
single = n - rows
count = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if count % 2 == 0:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		count += 1


(n, m) = input().split()
(n, m) = (int(n), int(m))
l = list()
for i in range(n):
	l.append(['.'] * m)
i = 1
flag = True
while i <= n:
	if i & 1 == 0:
		if flag == True:
			l[i - 1][m - 1] = '#'
			flag = not flag
		else:
			l[i - 1][0] = '#'
			flag = not flag
	else:
		j = 0
		while j < m:
			l[i - 1][j] = '#'
			j += 1
	i += 1
for i in l:
	print(''.join(i))


(n, m) = map(int, input().split())
d = 1
for i in range(n):
	print(('#', '')[d == 1] + '.' * (m - 1) + ('#', '')[d == 0] if i & 1 else '#' * m)
	if i & 1:
		d ^= 1


(a, b) = map(int, input().split())
i = 0
carr = '.'
car = '#'
while i < a // 2:
	if i % 2 != 0:
		print(car * b)
		print('#' + carr * (b - 1))
	else:
		print(car * b)
		print(carr * (b - 1) + '#')
	i += 1
print(car * b)


(n, l) = map(int, input().split())
s = '#'
f = 0
for i in range(n):
	if i % 2 == 0:
		print(s * l)
	else:
		f += 1
		if f % 2 == 0:
			print('#' + '.' * (l - 1))
		else:
			print('.' * (l - 1) + s)


(n, m) = [int(x) for x in input().split()]
row = n
col = m

def snake(row=m):
	print('#' * row)

def empty1(row=m):
	row = row - 1
	print('.' * row, end='')
	print('#')

def empty2(row=m):
	row = row - 1
	print('#', end='')
	print('.' * row)
count = 0
for i in range(row):
	if i % 2 == 0:
		snake()
	elif i % 2 == 1 and count == 0:
		empty1()
		count = 1
	elif i % 2 == 1 and count == 1:
		empty2()
		count = 0


[n, m] = [int(a) for a in input().split(' ')]
l = '#' * m
l1 = '.' * (m - 1) + '#'
l2 = '#' + '.' * (m - 1)
block = [l, l1, l, l2]
for i in range(n):
	print(block[i % len(block)])


l1 = input()
arr1 = list(map(lambda x: int(x), l1.split(' ')))
(n, m) = (arr1[0], arr1[1])
grid = []
show_right = True
i = 0
while i < n:
	if i % 2 == 0:
		grid.append(['#'] * m)
	else:
		t = ['.'] * m
		if show_right:
			t[-1] = '#'
		else:
			t[0] = '#'
		grid.append(t)
		show_right = not show_right
	i += 1
for row in grid:
	print(''.join(row))


(a, b) = map(int, input().split())
flag = 0
for i in range(a):
	if i % 2 == 0:
		print('#' * b)
	elif flag == 0:
		print('.' * (b - 1), end='# \n')
		flag = 1
	else:
		print('#', '.' * (b - 1), sep='')
		flag = 0


(n, m) = map(int, input().split())
a = '#' * m
b = '.' * (m - 1) + '#'
c = '#' + '.' * (m - 1)
for x in range(n):
	if x % 4 == 1:
		print(b)
	elif x % 4 == 3:
		print(c)
	else:
		print(a)


(a, b) = input().split()
a = int(a, 10)
b = int(b, 10)
for i in range(a):
	for j in range(b):
		if i % 2 == 0:
			if j < b - 1:
				print('#', end='')
			else:
				print('#')
		if i % 4 == 1:
			if j < b - 1:
				print('.', end='')
			else:
				print('#')
		if i % 4 == 3:
			if j == 0:
				print('#', end='')
			if j == b - 1:
				print('.')
			if 0 < j < b - 1:
				print('.', end='')


import sys
from math import sqrt
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	(n, m) = read()
	pat = ''
	for i in range(1, n + 1):
		pat += ('#' * m if i % 2 == 1 else '#' + '.' * (m - 1) if i % 4 == 0 else '.' * (m - 1) + '#') + '\n'
	print(pat)
solve()


def fox_and_snake():
	(row, col) = [int(x) for x in input().split(' ')]
	for i in range(row):
		if i % 2 == 0:
			print('#' * col)
		else:
			print('#' + '.' * (col - 1) if (i + 1) % 4 == 0 else str('.' * (col - 1)) + '#')
fox_and_snake()


(x, y) = map(int, input().split())
list = []
m = ''
n = 0
for c in range(1, x + 1):
	for i in range(1, y + 1):
		if c / 2 != int(c / 2):
			list.append('#')
		elif c / 2 == int(c / 2) and n == 0:
			if i == y:
				list.append('#')
				n = 1
			else:
				list.append('.')
		elif c / 2 == int(c / 2) and n == 1:
			if i == 1:
				list.append('#')
			else:
				list.append('.')
			if i == y:
				n = 0
	m = m.join(list)
	print(m)
	m = ''
	list.clear()


li = [int(i) for i in input().split()]
co = li[0]
ro = li[1]
c = 1
for i in range(co):
	if i % 2 == 0:
		print('#' * ro)
	elif c == 1:
		print('.' * (ro - 1) + '#')
		c = 0
	else:
		print('#' + '.' * (ro - 1))
		c = 1


(a, b) = map(int, input().split())
c = str()
x = int(1)
while x <= a:
	if x % 2 != 0:
		for y in range(b):
			c = c + '#'
		print(c)
		c = ''
	elif x % 4 == 0:
		c = c + '#'
		for y in range(b - 1):
			c = c + '.'
		print(c)
		c = ''
	else:
		for y in range(b - 1):
			c = c + '.'
		c = c + '#'
		print(c)
		c = ''
	x = x + 1


(n, m) = map(int, input().split())
k = 0
i = 0
while i < n:
	print(m * '#')
	i += 1
	if i < n:
		if k % 2 == 0:
			print('.' * (m - 1), '#', sep='')
		else:
			print('#', (m - 1) * '.', sep='')
		k += 1
	i += 1


def solve(n, l):
	singleTime = False
	leftTime = False
	for i in range(n):
		if not singleTime:
			print('#' * l)
			singleTime = not singleTime
		elif leftTime:
			print('#' + '.' * (l - 1))
			leftTime = not leftTime
			singleTime = not singleTime
		else:
			print('.' * (l - 1) + '#')
			singleTime = not singleTime
			leftTime = not leftTime
(n, w) = map(int, input().split())
solve(n, w)


a = input().split()
p = int(a[0])
l = int(a[1])
c = 2
for i in range(1, p + 1):
	if i % 2 == 1:
		print('#' * l)
	elif c % 2 == 0:
		print('.' * (l - 1) + '#')
		c += 1
	else:
		print('#' + '.' * (l - 1))
		c += 1


(n, m) = [int(a) for a in input().split()]
answer = ''
rtol = True
for i in range(n):
	flag = True
	row = ''
	if i % 2 == 0:
		flag = False
	for j in range(m):
		if flag:
			row += '.'
		else:
			row += '#'
	if flag:
		if rtol:
			answer += row[:-1] + '#\n'
		else:
			answer += '#' + row[1:] + '\n'
		rtol = not rtol
	else:
		answer += row + '\n'
print(answer[:-1])


(a, b) = map(int, input().split())
first = 0
c = 0
snake = ''
for x in range(1, a):
	if c == 0:
		for e in range(b):
			snake += '#'
		snake += '\n'
		c = 1
	if c % 2 == 1:
		if first == 0:
			for e in range(b):
				if e + 1 == b:
					snake += '#\n'
				else:
					snake += '.'
				first = 1
			c += 1
		else:
			snake += '#'
			for e in range(b - 1):
				if e + 1 == b - 1:
					snake += '.\n'
				else:
					snake += '.'
				first = 0
			c += 1
	else:
		for e in range(b):
			snake += '#'
		snake += '\n'
		c += 1
print(snake)


z = list(map(int, input().split()))
v = ['#']
b = []
c = 1
for i in range(z[1] * 2):
	if c % 2 == 0:
		v.append('.')
	else:
		b.append('#')
	c = c + 1
f = 0
v.remove('.')
for i in range(z[0]):
	f = f + 1
	if f % 2 == 0:
		v.reverse()
		d = ''.join(v)
		print(d)
	else:
		d = ''.join(b)
		print(d)


def main():
	(n, m) = tuple(map(int, input().rstrip().split()))
	ans = []
	flg = 1
	for i in range(n):
		if i % 2 == 0:
			ans += ['#' * m]
		else:
			if flg:
				ans += ['.' * (m - 1) + '#']
			else:
				ans += ['#' + '.' * (m - 1)]
			flg ^= 1
	print(*ans, sep='\n')
main()


(a, b) = [int(i) for i in input().split()]
for i in range(a):
	if i == 0:
		print('#' * b)
	elif i % 4 == 1:
		print('.' * (b - 1) + '#')
	elif i % 4 == 3:
		print('#' + '.' * (b - 1))
	elif i % 2 == 0:
		print('#' * b)
	elif i == a - 1:
		print('#' * (b - 1))


(N, M) = map(int, input().split())
for i in range(1, N + 1):
	if i % 2 == 0:
		if i % 4 == 0:
			print('#' + '.' * (M - 1))
		else:
			print('.' * (M - 1) + '#')
	else:
		print('#' * M)


a = [int(x) for x in input().split()]
n = a[0]
m = a[1]
k = []
p = []
for i in range(1, n + 1, 4):
	k.append(i)
for i in range(3, n + 1, 4):
	p.append(i)
for i in range(0, n):
	for j in range(0, m):
		if i % 2 == 0:
			print('#', end='')
		elif j == m - 1 and i in k:
			print('#', end='')
		elif j == 0 and i in p:
			print('#', end='')
		else:
			print('.', end='')
	print('')


(m, n) = map(int, input().split())
a = [['#'] * n for i in range(m)]
for i in range(1, m, 4):
	for j in range(n - 1):
		a[i][j] = '.'
for i in range(3, m, 4):
	for j in range(1, n):
		a[i][j] = '.'
for i in range(len(a)):
	print(*a[i], sep='')


in_ = input()
in_ = list(map(int, in_.split(' ')))
n = in_[0]
m = in_[1]
f = m * '#'
e = (m - 1) * '.' + '#'
s = '#' + (m - 1) * '.'
for i in range(n):
	if i % 2 == 0:
		print(f)
	elif (i - 1) % 4 == 0:
		print(e)
	else:
		print(s)


(n, m) = str(input()).split(' ')
(n, m) = (int(n), int(m))
x = '#' * m
y1 = '.' * (m - 1) + '#'
y2 = '#' + '.' * (m - 1)
for i in range(1, n + 1):
	if i & 1 == 1:
		print(x)
	else:
		print(y1)
		(y1, y2) = (y2, y1)


(n, m) = [int(x) for x in input().split()]
x = []
for i in range(n):
	if i % 2 == 0:
		x.append(['#' for i in range(m)])
	else:
		x.append(['.' for i in range(m)])
for i in range(n):
	if i % 4 == 3:
		x[i][0] = '#'
	else:
		x[i][m - 1] = '#'
print('\n'.join([''.join([str(cell) for cell in row]) for row in x]))


(n, k) = map(int, input().split())
runda = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * k)
	elif runda % 2 == 0:
		print('.' * (k - 1) + '#')
		runda += 1
	elif runda % 2 == 1:
		print('#' + '.' * (k - 1))
		runda += 1


(n, m) = [int(x) for x in input().split()]
for line in range(0, n):
	if line % 2 == 0:
		print('#' * m)
	elif (line + 1) % 4 == 0:
		print('#' + '.' * (m - 1))
	else:
		print('.' * (m - 1) + '#')


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
(n, m) = mi()
f = 0
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif f == 0:
		print('.' * (m - 1) + '#')
		f = 1
	else:
		print('#' + '.' * (m - 1))
		f = 0


l = list(input().split())
n = int(l[0])
m = int(l[1])
q = []
for i in range(1, n + 1):
	a = []
	if i % 2 != 0:
		for j in range(m):
			a.append('#')
	else:
		for j in range(m):
			a.append('.')
	if i % 4 == 0:
		a[0] = '#'
	else:
		a[m - 1] = '#'
	q.append(a)
for i in q:
	print(''.join(i))


s = input().strip()

def second(s):
	r = list(map(int, s.split(' ')))
	if r[1] < 3 or r[0] < 3 or r[1] > 50 or (r[0] > 50):
		print('Incorrect input')
	for i in range(r[0]):
		if i % 2 == 0:
			print(tag1(r[1]))
		if i % 4 == 1:
			print(tag2(r[1]))
		if i % 4 == 3:
			print(tag3(r[1]))

def tag1(s):
	d = ''
	for i in range(s):
		d = d + '#'
	return d

def tag2(s):
	d = ''
	for i in range(s - 1):
		d = d + '.'
	d = d + '#'
	return d

def tag3(s):
	d = '#'
	for i in range(s - 1):
		d = d + '.'
	return d
second(s)


(n, m) = input().split()
n = int(n)
m = int(m)
sk = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
j = 0
for i in range(1, n + 1):
	print(sk[j])
	j = j + 1
	if j == 4:
		j = 0


__author__ = 'myduomilia'
(n, m) = list(map(int, input().split()))
c = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if c:
			print('.' * (m - 1), '#', sep='')
		else:
			print('#', '.' * (m - 1), sep='')
		if c:
			c = False
		else:
			c = True


val = [int(n) for n in input().split()]
row = val[0]
col = val[1]
endsWithSnake = True
for i in range(row):
	level = ''
	for j in range(col):
		if (i + 1) % 2 == 0:
			if j == col - 1 and endsWithSnake or (j == 0 and (not endsWithSnake)):
				level += '#'
			else:
				level += '.'
		else:
			level += '#'
	if (i + 1) % 2 == 0:
		endsWithSnake = not endsWithSnake
	print(level)


(n, m) = map(int, input().split())
ceil = True
last_ceil = True
for i in range(0, n):
	if (i + 1) % 2 != 0:
		for j in range(0, m):
			print('#', end='')
	else:
		if last_ceil:
			for j in range(0, m - 1):
				print('.', end='')
			print('#', end='')
		else:
			print('#', end='')
			for j in range(1, m):
				print('.', end='')
		last_ceil = not last_ceil
	print()


def f():
	(x, y) = map(int, input().split())
	for a in range(1, x + 1):
		if a % 2 == 1:
			lst = ['#'] * y
			print(*lst, sep='')
		else:
			if a % 4 == 0:
				lst = ['#'] + ['.'] * (y - 1)
			else:
				lst = ['.'] * (y - 1) + ['#']
			print(*lst, sep='')
f()


(a, b) = [int(i) for i in input().split()]
c = []
side = True
for i in range(a):
	u = []
	for j in range(b):
		u.append('.')
	c.append(u)
for i in range(a):
	for j in range(b):
		if i % 2 == 0:
			c[i][j] = '#'
		elif i % 2 != 0:
			if side == True:
				c[i][-1] = '#'
				side = False
			elif side == False:
				c[i][0] = '#'
				side = True
			break
for i in range(a):
	print(*c[i], sep='')


nm = [int(i) for i in input('').split(' ')]
r = nm[0]
c = nm[1]
s = [''] * r
for i in range(0, r, 2):
	s[i] = c * '#'
for i in range(1, r - 1, 4):
	s[i] = (c - 1) * '.' + '#'
for i in range(3, r - 1, 4):
	s[i] = '#' + (c - 1) * '.'
print('\n'.join(s))


(r, c) = list(map(int, input().split()))

def main():
	board = []
	for i in range(r):
		board.append([])
		for j in range(c):
			board[i].append('.')
	i = 0
	count = 0
	while i < r:
		board[i] = '#' * c
		if i + 1 < r and count % 2 == 0:
			board[i + 1][c - 1] = '#'
			count += 1
		elif i + 1 < r and count % 2 != 0:
			board[i + 1][0] = '#'
			count += 1
		i += 2
	for row in board:
		print(''.join(row))
main()


(n, m) = map(int, input().split())
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	if i % 4 == 1:
		print(f"{'.' * (m - 1)}#")
	if i % 4 == 3:
		print(f"#{'.' * (m - 1)}")


l = list(map(int, input().split()))
st = '#'
st1 = '.'
for i in range(1, l[0] + 1):
	if i % 2 != 0:
		print(st * l[1])
	elif True:
		if i % 4 == 0:
			print(st + st1 * (l[1] - 1))
		else:
			print(st1 * (l[1] - 1) + st)


l = [int(i) for i in input().split()]
a = l[0]
b = l[1]
k = 0
for i in range(a):
	if i % 2 == 0:
		for j in range(b):
			print('#', end='')
		print('')
	elif k % 2 == 0:
		for j in range(b - 1):
			print('.', end='')
		print('#')
		k += 1
	else:
		print('#', end='')
		for j in range(b - 1):
			print('.', end='')
		print()
		k += 1


input_user = input()
(seta, setb) = input_user.split()
(n, m) = (int(seta), int(setb))

def g_hash(_, set_first='', set_final=''):
	s = ''
	s = s + '#' * m if _ == '#' else s + set_first + '.' * (m - 1) + set_final
	return s
s = ''
for k in range(n):
	s = s + g_hash('#') + '\n' + g_hash('.', set_final='#') + '\n' + g_hash('#') + '\n' + g_hash('.', '#') + '\n'
mapa = s.split()
final = '\n'
print(final.join(mapa[:n]))


s = input().split()
for i in range(int(s[0])):
	if i % 2 == 0:
		ns = '#' * int(s[1])
	elif (i + 1) / 2 % 2 != 0:
		ns = '.' * (int(s[1]) - 1) + '#'
	else:
		ns = '#' + '.' * (int(s[1]) - 1)
	print(ns)


(n, m) = map(int, input().split())
lis = [[0 for i in range(m)] for j in range(n)]
for k in range(n):
	for l in range(m):
		if (k + 1) % 2 != 0:
			lis[k][l] = '#'
		else:
			lis[k][l] = '.'
for a in range(1, n // 2 + 1):
	if a % 2 != 0:
		lis[2 * a - 1][m - 1] = '#'
	if a % 2 == 0:
		lis[2 * a - 1][0] = '#'
for b in range(n):
	print(''.join(lis[b]))


import time

def snake(a, b):
	if a == 0 or a == 2:
		return '#' * n
	elif a == 1:
		return '.' * (n - 1) + '#'
	return '#' + '.' * (n - 1)
(m, n) = map(int, input().split())
p = 0
s = ''
for i in range(m):
	s += snake(p, n) + '\n'
	p = (p + 1) % 4
print(s)


import re
ref = re.compile('\\d\\d|\\d')
n = input()
nums = ref.findall(n)
n = int(nums[0])
m = int(nums[1])
if n == 3:
	print('#' * m)
	print('.' * (m - 1) + '#')
	print('#' * m)
else:
	while True:
		if n >= 3:
			print('#' * m)
			print('.' * (m - 1) + '#')
		if (n - 1) / 2 > 1:
			print('#' * m)
			print('#' + '.' * (m - 1))
		elif n <= 1:
			print('#' * m)
			break
		n = n - 4


s = input().split()
m = int(s[0])
n = int(s[1])
a = n * '#'
b = (n - 1) * '.'
r = 1
while r <= m and 3 <= n <= 50 and (3 <= m <= 50):
	print(a)
	r = r + 1
	if r > m:
		break
	elif r % 4 == 0:
		print('#' + b)
		r = r + 1
	else:
		print(b + '#')
		r = r + 1


(a, b) = [int(i) for i in input().split()]
m = 0
for i in range(a):
	if i % 2 == 0:
		print('#' * b)
	elif m == 0:
		print('.' * (b - 1) + '#')
		m = 1
	else:
		print('#' + '.' * (b - 1))
		m = 0


(n, m) = map(int, input().split())
mat = []
k = 0
for i in range(n):
	a = ''
	if i % 2 == 0:
		a = '#' * m
	elif k % 2 == 0:
		a = '.' * (m - 1) + '#'
		k += 1
	else:
		a = '#' + '.' * (m - 1)
		k += 1
	mat.append(a)
for i in range(n):
	print(mat[i])


l = list(map(int, input().split()))
arr = []
for i in range(l[0]):
	arr.append('#' * l[1])
j = 1
x = 0
while j < len(arr):
	if x == 1:
		m = ''
		m += '.' * (len(arr[j]) - 1)
		m += '#'
		m = m[::-1]
		arr[j] = m
		j += 2
		x = 0
	else:
		s = ''
		s += '.' * (len(arr[j]) - 1)
		s += '#'
		arr[j] = s
		j += 2
		x = 1
for element in arr:
	print(element)


(n, m) = map(int, input().split())
a = ''
b = ''
c = ''
for i in range(m - 1):
	a += '#'
	b += '.'
	c += '.'
a += '#'
b += '#'
c = '#' + c
for j in range(n // 4):
	print(a)
	print(b)
	print(a)
	print(c)
if n % 4 == 1:
	print(a)
elif n % 4 == 2:
	print(a)
	print(b)
elif n % 4 == 3:
	print(a)
	print(b)
	print(a)


(n, m) = map(int, input().split())
M = [[0] * m for x in range(n)]
j = 0
k = 1
for i in range(1, n + 1):
	l = ''
	if i % 2 != 0:
		l = '#' * m
	elif i % 2 == 0 and k % 2 != 0:
		l = '.' * (m - 1) + '#'
		k = k + 1
	elif i % 2 == 0 and k % 2 == 0:
		l = '#' + '.' * (m - 1)
		k = k + 1
	print(l)


(h, w) = map(int, input().split())
a = '#' * w
b = '.' * (w - 1) + '#'
c = '#' + '.' * (w - 1)
t = [a, b, a, c]
x = 0
for i in range(h):
	print(t[x])
	x = (x + 1) % 4


(m, n) = [int(i) for i in input().split(' ')]

def pat(x1, x2):
	if x1 == 0:
		return '#' * x2
	elif x1 == 2:
		res = '.' * (x2 - 1)
		res = res + '#'
		return res
	else:
		res1 = '.' * (x2 - 1)
		res1 = '#' + res1
		return res1
for j in range(1, m + 1):
	if j % 2 == 0:
		if j // 2 % 2 == 0:
			print(pat(1, n))
		else:
			print(pat(2, n))
	else:
		print(pat(0, n))


(n, m) = [int(i) for i in input().split(' ')]
result = ''
snake = '#'
no_snake = '.'
is_end = True
for i in range(n):
	if i % 2 == 0:
		result += '#' * m
		result += '\n'
	elif is_end:
		result += '.' * (m - 1)
		result += '#\n'
		is_end = False
	elif not is_end:
		result += '#'
		result += '.' * (m - 1)
		result += '\n'
		is_end = True
print(result)


(x, y) = [int(x) for x in input().split()]
for i in range(x):
	for j in range(y):
		if i % 4 == 1 and j != y - 1:
			print('.', end='')
		elif i % 4 == 3 and j != 0:
			print('.', end='')
		else:
			print('#', end='')
	print()


(n, m) = map(int, input().split())
a = [['.' for j in range(m)] for i in range(n)]
for i in range(0, len(a)):
	if i % 2 == 0:
		a[i] = ['#'] * m
	elif i % 4 == 1:
		a[i][-1] = '#'
	else:
		a[i][0] = '#'
s = ''
for i in range(0, len(a)):
	s += ''.join(a[i]) + '\n'
print(s)


(n, m) = map(int, input().split())
dir = True
for x in range(n):
	if x % 2 == 0:
		for y in range(m):
			print('#', end='')
		print()
	else:
		if dir:
			for y in range(m - 1):
				print('.', end='')
			print('#')
		else:
			print('#', end='')
			for y in range(m - 1):
				print('.', end='')
			print()
		dir = not dir


s = input().split(' ')
for i in range(int(s[0])):
	if i % 2 != 0 and (i + 1) % 4 != 0:
		print('.' * (int(s[1]) - 1) + '#')
	elif (i + 1) % 4 == 0:
		print('#' + '.' * (int(s[1]) - 1))
	else:
		print('#' * int(s[1]))


def snake(n, m):
	l = [0] * 50
	for i in range(0, n, 2):
		l[i] = '#' * m
	for j in range(1, n, 4):
		l[j] = '.' * (m - 1) + '#'
	for k in range(3, n, 4):
		l[k] = '#' + '.' * (m - 1)
	for p in range(0, n):
		print(l[p])
(n, m) = map(int, input().split())
snake(n, m)


(m, n) = map(int, input().split())
p = []
for i in range(1, m + 1):
	if i % 2 != 0:
		p.append(['#'] * n)
	elif i % 4 == 0:
		p.append(['#'] + ['.'] * (n - 1))
	else:
		p.append(['.'] * (n - 1) + ['#'])
for el in p:
	for il in el:
		print(il, end='')
	print()


(n, m) = [int(x) for x in input().split()]
cell1 = ''
cell2 = ''
cell3 = '#'
for i in range(m - 1):
	cell1 = cell1 + '#'
	cell2 = cell2 + '.'
	cell3 = cell3 + '.'
cell1 = cell1 + '#'
cell2 = cell2 + '#'
for i in range(n):
	if (i + 1) % 2 == 1:
		print(cell1)
	elif (i + 1) % 4 == 2:
		print(cell2)
	elif (i + 1) % 4 == 0:
		print(cell3)


line = input()
n = int(line.split()[0])
m = int(line.split()[1])
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	if i % 4 == 1:
		print('.' * (m - 1) + '#')
	if i % 4 == 3:
		print('#' + '.' * (m - 1))


(row, col) = map(int, input().split())
ans = '#' * col + '\n'
row -= 1
lis = ['.' * (col - 1) + '#' + '\n' + '#' * col + '\n', '#' + '.' * (col - 1) + '\n' + '#' * col + '\n']
cod = 0
while row > 0:
	row -= 2
	ans += lis[cod % 2]
	cod += 1
print(ans)


def drawSnake(n, m):
	hashBool = True
	for row in range(n):
		for col in range(m):
			if row % 2 == 0:
				print('#', end='')
			else:
				if hashBool:
					hashSpace = m - 1
				else:
					hashSpace = 0
				if col == hashSpace:
					print('#', end='')
				else:
					print('.', end='')
		print()
		if row % 2 == 1:
			if hashBool == True:
				hashBool = False
			else:
				hashBool = True
[n, m] = [int(x) for x in input().split()]
drawSnake(n, m)


__author__ = 'denis'
(n, m) = map(int, input().split())
(s, t, s2, t2) = ('#' * m, '.' * (m - 1), '#' * m, '.' * (m - 1))
for i in range(n):
	print([s, t + '#', s2, '#' + t2][i % 4])


(n, m) = map(int, input().split())
s1 = [int(i) for i in range(1, 51, 4)]
s2 = [int(i) for i in range(3, 51, 4)]
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif i in s1 and j == m - 1:
			print('#', end='')
		elif i in s2 and j == 0:
			print('#', end='')
		else:
			print('.', end='')
	print()


x = input().split()
m = int(x[0])
n = int(x[1])
r = 1
while r <= m:
	if r % 2 != 0:
		z = ['#'] * n
		print(''.join(z))
	elif r % 4 == 0:
		z = ['#'] + ['.'] * (n - 1)
		print(''.join(z))
	else:
		z = ['.'] * (n - 1) + ['#']
		print(''.join(z))
	r = r + 1


(r, c) = map(int, input().split())
for i in range(r):
	if not i & 1:
		print('#' * c)
	elif (i - 1) // 2 & 1:
		print('#' + '.' * (c - 1))
	else:
		print('.' * (c - 1) + '#')


a = input().split(' ')
height = int(a[0])
width = int(a[1])
right = True
for y in range(height):
	if y % 2 == 0:
		for x in range(width):
			if x == width - 1:
				print('#')
			else:
				print('#', end='')
	elif right:
		for x in range(width):
			if x == width - 1:
				print('#')
			else:
				print('.', end='')
		right = False
	else:
		for x in range(width):
			if x == 0:
				print('#', end='')
			elif x == width - 1:
				print('.')
			else:
				print('.', end='')
		right = True


(n, m) = map(int, input().split())
st = ['#'] * m
flag = 1
for i in range(1, n):
	st2 = ['.'] * (m - 1)
	if i % 2 != 0:
		print(''.join((str(i) for i in st)))
	elif flag == 1:
		st2.append('#')
		print(''.join((str(i) for i in st2)))
		flag = 0
	else:
		st2.append('.')
		st2[0] = '#'
		flag = 1
		print(''.join((str(i) for i in st2)))
print(''.join((str(i) for i in st)))


(n, m) = [int(f) for f in input().split()]
pole = [['.' for x in range(m)] for y in range(n)]

def pr():
	for elem in pole:
		print(''.join(elem))
for i in range(len(pole)):
	if i % 2 == 0:
		for w in range(len(pole[i])):
			pole[i][w] = '#'
for s in range(1, len(pole), 4):
	pole[s][-1] = '#'
for s in range(3, len(pole), 4):
	pole[s][0] = '#'
pr()


(n, m) = map(int, input().split())
s = ''
a = ''
for i in range(m):
	s += '#'
	if i < m - 1:
		a += '.'
switch = False
switch1 = False
for i in range(n):
	if switch:
		if switch1:
			print('#' + a)
			switch1 = False
		else:
			print(a + '#')
			switch1 = True
		switch = False
	else:
		print(s)
		switch = True


(n, m) = map(int, input().split())
for i in range(m):
	print('#', end='')
print()
f = True
for i in range(1, n - 1):
	if i % 2 == 1:
		if f:
			f = False
			for j in range(m - 1):
				print('.', end='')
			print('#')
		else:
			f = True
			print('#', end='')
			for j in range(1, m):
				print('.', end='')
			print()
	else:
		for j in range(m):
			print('#', end='')
		print()
for j in range(m):
	print('#', end='')


(r, c) = map(int, input().split())
l = []
for i in range(r):
	a = []
	if i % 2 == 0:
		for j in range(c):
			a.append('#')
		l.append(a)
	else:
		x = (i + 1) // 2
		if x % 2 == 0:
			a.append('#')
			for j in range(1, c):
				a.append('.')
			l.append(a)
		else:
			for j in range(c - 1):
				a.append('.')
			a.append('#')
			l.append(a)
for i in range(r):
	for j in range(c):
		print(l[i][j], end='')
	print()


(n, m) = map(int, input().split())
is_swap = 1
for i in range(n):
	for j in range(m):
		if i & 1 == 0:
			print('#', end='')
		elif not is_swap and j != m - 1:
			print('.', end='')
		elif not is_swap and j == m - 1:
			print('#', end='')
		elif is_swap and j != 0:
			print('.', end='')
		elif is_swap and j == 0:
			print('#', end='')
	if i & 1 == 0:
		is_swap = not is_swap
	print()


(n, m) = list(map(int, input().split()))
(j, p) = (0, 0)
g = '.' * (m - 1)
for i in range(0, n):
	if i == 0 or i % 2 == 0:
		print('#' * m)
	else:
		if i == 1 + 2 * j:
			print(g + '#')
			j += 2
		if i == 3 + 2 * p:
			print('#' + g)
			p += 2


(n, m) = map(int, input().split())
print('\n'.join((['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + (m - 1) * '.'] * ((n + 3) // 4))[:n]))


import math
(n, m) = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
	for j in range(0, m):
		if i % 2 == 0:
			x = '#'
		elif math.floor(i / 2) % 2 == 0 and j == m - 1:
			x = '#'
		elif math.floor(i / 2) % 2 == 1 and j == 0:
			x = '#'
		else:
			x = '.'
		print(x, end='')
	print()


def main():
	(n, m) = map(int, input().split())
	a = [['.' for _ in range(m)] for _ in range(n)]
	flag = False
	for i in range(n):
		for j in range(m):
			if i % 2 == 0:
				a[i][j] = '#'
		if i % 2 != 0:
			if not flag:
				a[i][-1] = '#'
				flag = True
			else:
				a[i][0] = '#'
				flag = False
	for i in range(n):
		for j in range(m):
			print(a[i][j], end='')
		print()
main()


a = list(map(int, input().split()))
for i in range(1, a[0] + 1):
	if i % 2 != 0:
		for i in range(a[1] - 1):
			print('#', end='')
		print('#')
	else:
		c = i / 2
		if c % 2 != 0:
			for k in range(0, a[1] - 1):
				print('.', end='')
			print('#')
		else:
			print('#', end='')
			for k in range(0, a[1] - 2):
				print('.', end='')
			print('.')


def solve(n, m):
	flag = False
	x = 0
	while x < n:
		print('#' * m)
		if x == n - 1:
			return
		if flag:
			print('#' + '.' * (m - 1))
		else:
			print('.' * (m - 1) + '#')
		flag = not flag
		x += 2
(n, m) = list(map(int, input().split()))
solve(n, m)


(r, c) = map(int, input().split())
toggle = True
for i in range(2, r, 2):
	print('#' * c)
	if toggle == True:
		print('.' * (c - 1) + '#')
	else:
		print('#' + '.' * (c - 1))
	toggle = not toggle
print('#' * c)


(r, c) = map(int, input().split())
s = '#' * c
m = '.' * (c - 1) + '#'
for i in range(r):
	if i % 2:
		if i // 2 % 2:
			print(m[::-1])
		else:
			print(m)
	else:
		print(s)


def Main():
	(n, m) = map(int, input().split())
	for i in range(1, n + 1):
		if i % 2 == 1:
			print('#' * m)
		elif i // 2 % 2 == 1:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
Main()


(a, b) = map(int, input().split())
string = '#'
width = b
i = 0
for i in range(1, a + 1):
	if i % 2 != 0:
		print('#' * b)
	elif i / 2 % 2 == 0:
		print(string.ljust(width, '.'))
	else:
		print(string.rjust(width, '.'))


(n, m) = tuple(map(int, input().strip(' ').split(' ')))
this = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 2 != 0:
		if this:
			print('.' * (m - 1), '#', sep='')
			this = False
		else:
			print('#', '.' * (m - 1), sep='')
			this = True


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 != 0:
		print(''.join(m * ['#']))
	elif i / 2 % 2 == 0:
		l = []
		l.append('#')
		l.extend((m - 1) * ['.'])
		print(''.join(l))
	else:
		l = (m - 1) * ['.']
		l.append('#')
		print(''.join(l))


(n, m) = [int(x) for x in input().split()]
a = ['#' for _ in range(m)]
b = ['.' for _ in range(m)]
b[0] = '#'
c = ['.' for _ in range(m)]
c[m - 1] = '#'
for i in range(n):
	if i % 4 == 0 or i % 4 == 2:
		print(''.join(a))
	elif i % 4 == 1:
		print(''.join(c))
	else:
		print(''.join(b))


(n, m) = map(int, input().split())
table = []
for lin in range(n):
	table.append('')
	for col in range(m):
		if lin % 2 == 0:
			table[lin] += '#'
		elif lin % 4 == 1 and col == m - 1:
			table[lin] += '#'
		elif lin % 4 == 3 and col == 0:
			table[lin] += '#'
		else:
			table[lin] += '.'
for i in range(len(table)):
	print(table[i])


(n, m) = [int(x) for x in input().split()]
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	else:
		a = '.' * (m - 1)
		if i % 2 == 0 and i % 4 != 0:
			print(a + '#')
		else:
			print('#' + a)


(n, m) = map(int, input().split())
right = True
r_row = '.' * (m - 1) + '#'
l_row = '#' + '.' * (m - 1)
even = '#' * m
for i in range(n):
	if i & 1:
		if right:
			print(r_row)
			right = not right
		else:
			print(l_row)
			right = not right
	else:
		print(even)


def prog():
	(n, m) = map(int, input().split())
	a = 0
	b = 2
	for i in range(n):
		if i == a:
			print('#' * m, sep='')
			a += 2
		elif b == 2:
			print('.' * (m - 1), '#', sep='')
			b = 1
		else:
			print('#', '.' * (m - 1), sep='')
			b = 2
prog()


a = [int(x) for x in input().split()]
b = [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49]
c = [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47]
for i in range(a[0]):
	if i == 0 or i % 2 == 0:
		for j in range(a[1] - 1):
			print('#', end='')
		print('#')
	elif i in b:
		for j in range(a[1] - 1):
			print('.', end='')
		print('#')
	elif i in c:
		print('#', end='')
		for j in range(1, a[1] - 1):
			print('.', end='')
		print('.')


def solve():
	(n, m) = [int(s) for s in input().split()]
	ans = []
	k = 1
	for i in range(n):
		if i % 2 == 0:
			print('#' * m)
		else:
			if k == 1:
				print('.' * (m - 1) + '#')
			else:
				print('#' + '.' * (m - 1))
			k = (k + 1) % 2
solve()


input_of_pc = input().split()
counter_vertical = int(input_of_pc[0])
counter_horizontal = int(input_of_pc[1])
storage = []
counter_storage = 0
if counter_vertical > counter_horizontal:
	biggest = counter_vertical
elif counter_horizontal > counter_vertical:
	biggest = counter_horizontal
elif counter_horizontal == counter_vertical:
	biggest = counter_horizontal
for x in range(1, biggest):
	storage.append(int(x))
while counter_vertical != 0:
	if counter_vertical % 2 != 0:
		print('#' * counter_horizontal)
		counter_vertical -= 1
	elif counter_vertical % 2 == 0:
		if storage[counter_storage] % 2 != 0:
			print('.' * int(counter_horizontal - 1) + '#')
			counter_vertical -= 1
			counter_storage += 1
		elif storage[counter_storage] % 2 == 0:
			print('#', end='')
			print('.' * int(counter_horizontal - 1))
			counter_vertical -= 1
			counter_storage += 1


(n, m) = list(map(int, input().split()))
if n == 1:
	for i in range(m):
		print('#', end='')
		if i == m:
			break
if n % 2 == 0:
	for i in range(n // 2):
		if i % 2 == 0:
			for j in range(m):
				print('#', end='')
			print()
			for j in range(m - 1):
				print('.', end='')
			print('#')
		if i % 2 != 0:
			for j in range(m):
				print('#', end='')
			print()
			print('#', end='')
			for j in range(m - 1):
				print('.', end='')
			print()
else:
	for i in range(n // 2):
		if i % 2 == 0:
			for j in range(m):
				print('#', end='')
			print()
			for j in range(m - 1):
				print('.', end='')
			print('#')
		if i % 2 != 0:
			for j in range(m):
				print('#', end='')
			print()
			print('#', end='')
			for j in range(m - 1):
				print('.', end='')
			print()
	for j in range(m):
		print('#', end='')
	print()


(n, m) = map(int, input().split())
cnt = 1
t = m - 1
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif cnt % 2 != 0:
		print('.' * t, end='')
		print('#')
		cnt = cnt + 1
	else:
		print('#', end='')
		print('.' * t)
		cnt = cnt + 1


(x, y) = map(int, input('').split())
a = ''
b = ''
c = '#'
for i in range(y):
	a = a + '#'
for i in range(y - 1):
	b = b + '.'
b = b + '#'
for i in range(y - 1):
	c = c + '.'
l = [a, b, c]
z = []
for i in range(1, x + 1):
	if i % 2 != 0:
		z.append(a)
	elif i % 4 == 0:
		z.append(c)
	else:
		z.append(b)
for i in z:
	print(i)


(n, m) = map(int, input().split())
a = '#' * m
b = '.' * (m - 1) + '#'
c = '#' + '.' * (m - 1)
s = []
for i in range(n):
	if i % 2 == 0:
		s.append(a)
	elif i % 4 == 1:
		s.append(b)
	else:
		s.append(c)
for x in s:
	print(x)


(leng, wigh) = map(int, input().split())
cnt = 0
for i in range(leng):
	(st, cnt) = ('#', cnt + 1)
	for q in range(wigh - 1):
		if cnt % 4 == 0:
			st = st + '.'
		elif cnt % 2 == 0:
			st = '.' + st
		else:
			st = '#' + st
	print(st)


b = input().split()
n = int(b[0])
m = int(b[1])
s = ''
i = 0
c = 0
z = True
f = True
while m > i:
	s = s + '#'
	i += 1
a = s[0]
b = s[-1]
while n > 0:
	print(s)
	i = 0
	s = ''
	if a == '#' and b == '#' and f:
		while m - 1 > i:
			s = s + '.'
			i += 1
			f = False
			z = True
		s = s + '#'
	elif a == '.' and b == '#':
		while m > i:
			s = s + '#'
			i += 1
	elif a == '#' and b == '#' and z:
		s = s + '#'
		while m - 1 > i:
			s = s + '.'
			i += 1
			f = True
			z = False
	elif a == '#' and b == '.':
		while i < m:
			s = s + '#'
			i += 1
	a = s[0]
	b = s[-1]
	n -= 1


[n, m] = [int(x) for x in input().split(' ')]
f = 0
for i in range(n):
	temp = []
	if i % 2 == 0:
		temp = ['#' for x in range(m)]
		print(''.join(temp))
	else:
		temp = ['.' for x in range(m - 1)]
		temp.append('#')
		if i % 2 == 1 and f == 0:
			print(''.join(temp))
			f = 1
			continue
		elif i % 2 == 1 and f == 1:
			temp.reverse()
			print(''.join(temp))
			f = 0
			continue


(n, m) = map(int, input().split())
grid = [['.' for _ in range(m)] for _ in range(n)]
for i in range(0, n, 2):
	grid[i] = '#' * m
for i in range(1, n, 2):
	if i % 4 == 1:
		grid[i][-1] = '#'
	else:
		grid[i][0] = '#'
for row in grid:
	print(''.join(row))


(n, m) = [int(x) for x in input().split()]
ans = []
a = True
for i in range(n):
	ans.append(list('.' * m) if i % 2 else list('#' * m))
	if i % 2:
		if a:
			ans[-1][m - 1] = '#'
		else:
			ans[-1][0] = '#'
		a = not a
for line in ans:
	for i in line:
		print(i, end='')
	print()


a = list((int(x) for x in input().split()))
for i in range(a[0]):
	if i % 2 == 0:
		print(a[1] * '#', end='\n')
	elif i % 4 == 1:
		print((a[1] - 1) * '.' + '#', end='\n')
	else:
		print('#' + (a[1] - 1) * '.')


import sys
import math as m

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def linp():
	return list(map(int, sys.stdin.readline().strip().split()))

def p(a):
	print(a)
(n, m) = ninp()
f = 0
while True:
	if n == 0:
		break
	elif n % 2 == 1:
		for i in range(m):
			print('#', end='')
		print()
		n = n - 1
	elif n % 2 == 0 and f == 0:
		for i in range(m - 1):
			print('.', end='')
		print('#')
		n = n - 1
		f = 1
	elif n % 2 == 0 and f == 1:
		print('#', end='')
		for i in range(m - 1):
			print('.', end='')
		print()
		n = n - 1
		f = 0


nm = [int(x) for x in input().split()]
data = [['.' for x in range(nm[1])] for y in range(nm[0])]
for i in range(0, len(data), 2):
	data[i] = ['#' for x in range(nm[1])]
stat = -1
for i in range(1, len(data), 2):
	if stat == -1:
		data[i] = ['.' for x in range(nm[1] - 1)] + ['#']
		stat = 1
	else:
		data[i] = ['#'] + ['.' for x in range(nm[1] - 1)]
		stat = -1
for y in range(len(data)):
	for x in range(len(data[y])):
		print(data[y][x], end='' if x < len(data[y]) - 1 else '\n')


(x, y) = map(int, input().split())
c = '.' * (y - 1)
d = '#'
for i in range(x):
	if i % 2 == 0:
		print('#' * y)
	elif (i + 1) % 4 == 0:
		print(d + c)
	else:
		print(c + d)


(n, m) = map(int, input().split())
x = '.' * (m - 1)
y = '#'
z = '#' * m
for i in range(n):
	if i % 2 == 0:
		print(z)
	else:
		print('{}{}'.format(x, y))
		(x, y) = (y, x)


(n, m) = map(int, input().split())
l = []
temp1 = []
temp2 = []
temp3 = []
for i in range(m - 1):
	temp1.append('#')
	temp2.append('.')
	temp3.append('.')
temp1.append('#')
temp2.append('#')
temp3.insert(0, '#')
if n == 3:
	l.append(temp1)
	l.append(temp2)
	l.append(temp1)
elif (n - 1) % 4 == 0:
	for i in range((n - 1) // 4):
		l.append(temp1)
		l.append(temp2)
		l.append(temp1)
		l.append(temp3)
	l.append(temp1)
else:
	for i in range((n - 3) // 4):
		l.append(temp1)
		l.append(temp2)
		l.append(temp1)
		l.append(temp3)
	l.append(temp1)
	l.append(temp2)
	l.append(temp1)
for i in l:
	a = ''
	for j in range(m):
		a += i[j]
	print(a)


b = 0
(z, x) = [int(e) for e in input().split()]
for c in range(z):
	for v in range(x):
		if c % 2 == 0:
			if v == x - 1:
				print('#')
				break
			else:
				print('#', end='')
		elif b == 0:
			if v == x - 1:
				print('#')
				b = 1
				break
			else:
				print('.', end='')
		elif v == 0:
			print('#', end='')
		elif v == x - 1:
			print('.')
			b = 0
			break
		else:
			print('.', end='')


(a, b) = map(int, input().split())
draw = []
for i in range(a):
	c = ['.'] * b
	draw.append(c)
for j in range(a):
	if (j + 1) % 2 == 1:
		for k in range(b):
			draw[j][k] = '#'
	elif (j + 1) % 4 == 2:
		draw[j][b - 1] = '#'
	elif (j + 1) % 4 == 0:
		draw[j][0] = '#'
for k in range(a):
	print(''.join(draw[k]))


def res(r, c):
	check = 1
	for i in range(r):
		if i % 2 == 0:
			print('#' * c)
		elif check == 1:
			print('.' * (c - 1) + '#')
			check = 0
		else:
			print('#' + '.' * (c - 1))
			check = 1
(r, c) = map(int, input().split())
res(r, c)


l = list(map(int, input().rstrip().split()))
for i in range(1, l[0] + 1):
	if i % 4 == 0:
		print('#', end='')
		for j in range(l[1] - 1):
			print('.', end='')
		print('')
	elif i % 2 == 0 and i % 4 != 0:
		for j in range(l[1] - 1):
			print('.', end='')
		print('#')
	else:
		for j in range(l[1]):
			print('#', end='')
		print('')


def patt1(n, m):
	print('#' * m)
	print('.' * (m - 1), end='')
	print('#')

def patt2(n, m):
	print('#' * m)
	print('#', end='')
	print('.' * (m - 1))
(n, m) = map(int, input().split())
num = n // 2
if num < 2:
	patt1(n, m)
	print('#' * m)
else:
	i = 1
	while i <= num:
		if i % 2 != 0:
			patt1(n, m)
		elif i % 2 == 0:
			patt2(n, m)
		i = i + 1
	print('#' * m)


(n, m) = map(int, input().split())
a = [['.'] * m for i in range(n)]
b = [False]
r = 1
for i in range(n):
	if (i + 1) % 2 == 1:
		for j in range(m):
			a[i][j] = '#'
	elif (i + 1) % 2 == 0:
		if b[r - 1] == False:
			a[i][m - 1] = '#'
			b.append(True)
			r = r + 1
		else:
			a[i][0] = '#'
			b.append(False)
			r = r + 1
for i in range(len(a)):
	print(''.join(a[i]))


(n, m) = map(int, input().split())
str1 = ''
str2 = ''
count = 1
for j in range(m - 1):
	str2 += '.'
str2 += '#'
str3 = str2[::-1]
for _ in range(m):
	str1 += '#'
for i in range(1, n + 1):
	if i % 2 != 0:
		print(str1)
	if i % 2 == 0 and count % 2 != 0:
		print(str2)
		count += 1
	elif i % 2 == 0 and count % 2 == 0:
		print(str3)
		count += 1


(n, m) = list(map(int, input().split(' ')))
a = ['#'] * m
b = ['.'] * m
c = b.copy()
for i in range(1, n + 1):
	if i % 2 == 1:
		print(''.join(a))
	elif i % 4 == 0:
		b[0] = '#'
		print(''.join(b))
	elif i % 2 == 0 and i % 4 != 0:
		c[m - 1] = '#'
		print(''.join(c))


(a, b) = list(map(int, input().split()))
a -= 3
ans = '#' * b + '\n' + '.' * (b - 1) + '#\n' + '#' * b + '\n'
l = True
while a != 0:
	if l:
		ans += '#'
	ans += '.' * (b - 1)
	if not l:
		ans += '#'
	ans += '\n' + '#' * b + '\n'
	l = not l
	a -= 2
print(ans.strip())


__author__ = 'Utena'
(n, m) = map(int, input().split())
for i in range(1, n + 1):
	s = ['.'] * m
	if i % 2 == 1:
		s = ['#'] * m
	elif i // 2 % 2 == 1:
		s[-1] = '#'
	else:
		s[0] = '#'
	print(''.join(s))


(m, n) = map(int, input().split())
x = '#' * n
print(x)
count = 1
y = m // 2
if n < 3 or n > 50 or m < 3 or (m > 50):
	pass
while count <= y:
	if count % 2 == 1:
		a = '.' * (n - 1) + '#'
		print(a)
		print(x)
		count = count + 1
	else:
		a = '#' + '.' * (n - 1)
		print(a)
		print(x)
		count = count + 1


nt = list(map(int, input().split()))
a = ''
c = 0
while c < nt[0]:
	sh = 0
	a = ''
	if c % 2 == 0:
		while sh < nt[1]:
			a += '#'
			sh = sh + 1
		print(a)
	ch = 0
	if c % 2 == 1:
		while sh < nt[1]:
			if c % 4 == 3 and ch == 0:
				a += '#'
				ch = 1
				sh = sh + 1
			a += '.'
			sh = sh + 1
			if sh == nt[1] - 1 and c % 4 != 3:
				a += '#'
				sh = sh + 1
		print(a)
	c = c + 1


(r, c) = input().split()
r = int(r)
c = int(c)
hash = ''
dot = ''
for i in range(c):
	hash = hash + '#'
for i in range(c - 1):
	dot = dot + '.'
dot = dot + '#'
for i in range(r):
	if i % 2 == 0:
		print(hash)
	else:
		print(dot)
		dot = dot[::-1]


(R, C) = list(map(int, input().split()))
for r in range(1, R + 1):
	if r % 2 != 0:
		print('#' * C)
	elif r % 4 == 0:
		print('#' + '.' * (C - 1))
	else:
		print('.' * (C - 1) + '#')


(n, m) = map(int, input().split(' '))
i = 1
snake = '#'
empt = '.'
while i <= n:
	if i % 2 == 1:
		print(snake * m)
	elif i % 4 == 0:
		print(snake + empt * (m - 1))
	else:
		print(empt * (m - 1) + snake)
	i += 1


a = [int(i) for i in input().split()]
c = a[1] - 1
h = 1
u = 0
for b1 in range(a[0]):
	if b1 % 2 != 0:
		if h > u:
			for b2 in range(1):
				print('.' * c + '#', end='')
				print()
				u += 1
		elif u >= h:
			for b2 in range(1):
				print('#' + c * '.', end='')
				print()
				h += 1
	elif b1 % 2 == 0:
		for b2 in range(1):
			print('#' * a[1], end='')
			print()


(n, m) = input().split()
n = int(n)
m = int(m)
strFull = m * '#'
strLeft = '#' + (m - 1) * '.'
strRight = (m - 1) * '.' + '#'
isLeft = False
for i in range(1, n + 1):
	if i % 2 > 0:
		print(strFull)
	elif isLeft:
		isLeft = False
		print(strLeft)
	else:
		isLeft = True
		print(strRight)


(n, m) = map(int, input().split())
data = [['#' for _ in range(m)] for _ in range(n)]
left = True
for i in range(1, n, 2):
	if left:
		for j in range(m - 1):
			data[i][j] = '.'
		left = False
	else:
		for j in range(m - 1):
			data[i][m - 1 - j] = '.'
		left = True
for i in range(n):
	for j in range(m):
		print(data[i][j], end='')
	print()


a = list(map(int, input().strip().split(' ')))
c = 0
for i in range(a[0]):
	if i & 1:
		print('\n', end='')
		if c & 1:
			print('#', end='')
			for j in range(a[1] - 1):
				print('.', end='')
			print()
		else:
			for j in range(a[1] - 1):
				print('.', end='')
			print('#')
		c += 1
	else:
		for j in range(a[1]):
			print('#', end='')


(n, k) = (int(x) for x in input().split())
ch = ''
ch1 = ''
for i in range(k - 1):
	ch1 += '.'
	ch += '#'
ch += '#'
kk = 2
l = 4
for i in range(1, n + 1):
	if i % 2 != 0:
		print(ch)
	if i == kk:
		print(ch1 + '#')
		kk += 4
	if i == l:
		print('#' + ch1)
		l += 4


s = input()
a = s.split()
for i in range(len(a)):
	a[i] = int(a[i])
i = 1
dem = 2
while i <= a[0]:
	if i % 2 != 0:
		for j in range(a[1] - 1):
			print('#', end='')
		print('#')
	elif dem == 2:
		for j in range(a[1] - 1):
			print('.', end='')
		print('#')
		dem = 4
	else:
		print('#', end='')
		for j in range(a[1] - 1):
			print('.', end='')
		dem = 2
		print()
	i += 1


(n, m) = map(int, input().split())
count = 0
for x in range(n):
	if x % 2 != 1:
		count += 1
	for y in range(m):
		if x % 2 == 0:
			print('#', end='')
		elif x % 2 != 0:
			if y != m - 1 and count % 2 != 0:
				print('.', end='')
			elif y == 0 and count % 2 == 0:
				print('#', end='')
			elif y == m - 1 and count % 2 != 0:
				print('#', end='')
			elif y != 0 and count % 2 == 0:
				print('.', end='')
	print()


(x, y) = map(int, input().split())
c = 0
for i in range(x):
	if i % 2 == 0:
		print('#' * y)
	elif c == 0:
		x = '.' * (y - 1)
		print(f'{x}#')
		c = 1
	elif c == 1:
		x = '.' * (y - 1)
		print(f'#{x}')
		c = 0


(n, m) = map(int, input().split())
a = '#' * m
b = '.' * (m - 1) + '#'
c = '#' + '.' * (m - 1)
print(a)
f = (n - 1) / 2
while f > 0:
	print(b)
	print(a)
	f -= 1
	if f > 0:
		print(c)
		print(a)
		f -= 1


counter = 0
counter2 = 0
(n, m) = map(int, input().split())
b = m - 1
for i in range(n):
	counter += 1
	if counter % 2 != 0:
		print(m * '#')
	else:
		counter2 += 1
		if counter2 % 2 != 0:
			print(b * '.', end='')
			print('#')
		else:
			print('#', end='')
			print(b * '.')


(n, m) = list(map(int, input().split(' ')))
flag = True
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m, end='')
		print()
	elif flag == True:
		line = '.' * (m - 1) + '#'
		print(line)
		flag = False
	else:
		line = '#' + '.' * (m - 1)
		print(line)
		flag = True


(n, m) = map(int, input().split())
q = ''
r = 0
e = 0
for i in range(0, n):
	if r == 0:
		for i in range(0, m):
			q += '#'
		print(q)
		r = 1
		q = ''
	elif e == 0:
		for i in range(0, m - 1):
			q += '.'
		q += '#'
		print(q)
		r = 0
		q = ''
		e = 1
	else:
		q += '#'
		for i in range(0, m - 1):
			q += '.'
		print(q)
		r = 0
		e = 0
		q = ''


(m, n) = map(int, input().split())
v = {0: '#' * n, 1: '.' * (n - 1) + '#', 2: '#' * n, 3: '#' + '.' * (n - 1)}
for i in range(m):
	print(v[i % 4])


x = input().split()
a = int(x[0])
b = int(x[1])
c = []
d = []
for i in range(b):
	c.append('#')
	if i < b - 1:
		d.append('.')
	elif i == b - 1:
		d.append('#')
emon = ''.join(c)
emon1 = ''.join(d)
emon2 = emon1[-1::-1]
max = emon2
for i in range(a):
	if i % 2 == 0:
		print(emon)
	elif emon1 != max:
		print(emon1)
		max = emon1
	else:
		print(emon2)
		max = emon2


(m, n) = map(int, input().split())
for i in range(m):
	if (i + 1) % 2 == 1:
		a = ['#'] * n
		print(''.join(a))
	elif (i + 1) % 4 == 0:
		b = '#'
		print(b.ljust(n, '.'))
	elif (i + 1) % 4 == 2:
		c = '#'
		print(c.rjust(n, '.'))


(n, m) = map(int, input().split())
A = []
B = []
C = []
for i in range(m):
	A.append('#')
	B.append('.')
	C.append('.')
B[-1] = '#'
C[0] = '#'
for x in range(1, n + 1):
	if x % 2 == 1:
		print(''.join(A))
	elif x % 4 == 2:
		print(''.join(B))
	else:
		print(''.join(C))


def r(t=int):
	return list(map(t, input().split()))

def ri(t=int):
	return t(input())

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
(a, b) = r()
for ai in range(1, a + 1):
	if ai % 2:
		print('#' * b)
	elif ai % 4:
		print('.' * (b - 1) + '#')
	else:
		print('#' + '.' * (b - 1))


from sys import stdin, stdout
nm = list(map(int, stdin.readline().split()))
n = nm[0]
m = nm[1]
for i in range(1, n + 1):
	if i % 2 == 1:
		stdout.write(m * '#')
		stdout.write('\n')
	elif i / 2 % 2 == 1:
		stdout.write((m - 1) * '.')
		stdout.write('#\n')
	else:
		stdout.write('#')
		stdout.write((m - 1) * '.' + '\n')


line = input().split()
n = int(line[0])
m = int(line[1])
i = 1
while i <= n:
	if i % 2 != 0:
		print('{}'.format('#' * m))
		i = i + 1
	elif i % 4 != 0:
		print('{}#'.format('.' * (m - 1)))
		i = i + 1
	else:
		print('#{}'.format('.' * (m - 1)))
		i = i + 1


(n, m) = map(int, input().split())
zmeya = []
a = 0
for i in range(n):
	if i % 2 == 0:
		zmeya.append(['#' * m])
	elif a == 0:
		zmeya.append(['.' * (m - 1), '#'])
		a = 1
	elif a == 1:
		zmeya.append(['#', '.' * (m - 1)])
		a = 0
for elem in zmeya:
	print(*elem, sep='')


import sys
import math
(n, m) = [int(x) for x in sys.stdin.readline().split()]
a1 = ['#'] * m
a2 = ['.'] * (m - 3)
a2.extend(['.', '.', '#'])
a3 = ['#', '.', '.']
a3.extend(['.'] * (m - 3))
k = 0
for i in range(1, n + 1):
	if i % 2 != 0:
		print(''.join(a1))
	elif i / 2 % 2 != 0:
		print(''.join(a2))
	else:
		print(''.join(a3))


(a, b) = [int(i) for i in input().split()]
for t in range(1, a + 1):
	if t % 4 == 1 or t % 4 == 3:
		string = ''
		for z0 in range(b):
			string += '#'
		print(string)
	if t % 4 == 2:
		string = ''
		for z0 in range(b - 1):
			string += '.'
		string += '#'
		print(string)
	if t % 4 == 0:
		string = '#'
		for z0 in range(b - 1):
			string += '.'
		print(string)


strings = input().split(' ')
snake = []
tail = True
for i in range(int(strings[0])):
	snake.append([])
	if i % 2 == 0:
		for j in range(int(strings[1])):
			snake[i].append('#')
		print_string = ''.join(snake[i])
		print(print_string)
		continue
	if tail == True:
		for j in range(int(strings[1]) - 1):
			snake[i].append('.')
		snake[i].append('#')
		tail = False
	elif tail == False:
		snake[i].append('#')
		for j in range(1, int(strings[1])):
			snake[i].append('.')
		tail = True
	print_string = ''.join(snake[i])
	print(print_string)


(n, m) = input().split(' ')
n = int(n)
m = int(m)
s1 = '#'
s2 = '.'
if n % 2 == 0 or n < 3 or m > 50:
	exit
if n == 3:
	print(s1 * m)
	print(s2 * (m - 1) + s1)
	print(s1 * m)
if n >= 5:
	for i in range(n):
		if i % 4 == 0:
			print(s1 * m)
		if i % 4 == 1:
			print(s2 * (m - 1) + s1)
		if i % 4 == 2:
			print(s1 * m)
		if i % 4 == 3:
			print(s1 + s2 * (m - 1))


(n, m) = input().split(' ')
n = int(n)
m = int(m)
a = [['.' for j in range(m + 1)] for i in range(n + 1)]
flag = 1
for i in range(1, n + 1, 1):
	for j in range(1, m + 1, 1):
		if i % 2 == 0:
			if flag == 1:
				a[i][m] = '#'
				flag = 0
			else:
				a[i][1] = '#'
				flag = 1
			break
		else:
			a[i][j] = '#'
for i in range(1, n + 1, 1):
	for j in range(1, m + 1, 1):
		print(a[i][j], end='')
	print('')


(n, m) = [int(x) for x in input().split()]

def odd(x):
	print('#' * x)

def even1(y):
	print('.' * (y - 1), end='')
	print('#')

def even0(y):
	print('#', end='')
	print('.' * (y - 1))
for i in range(n):
	if (i + 1) % 2 == 1:
		odd(m)
	elif (i + 1) % 4 == 2:
		even1(m)
	else:
		even0(m)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
(n, m) = get_ints()
for i in range(1, n + 1):
	if not i % 4:
		print('#' + '.' * (m - 1))
	elif not i % 2:
		print('.' * (m - 1) + '#')
	else:
		print('#' * m)


(n, m) = map(int, input().split())
d = ''
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(m):
			d += '#'
	elif i % 4 == 2:
		for k in range(m - 1):
			d += '.'
		d += '#'
	elif i % 4 == 0:
		d += '#'
		for k in range(m - 1):
			d += '.'
	d += '\n'
print(d)


s = input()
(n, m) = s.split(' ')
n = int(n)
m = int(m)
s1 = ''
s2 = '#'
s3 = '#'
for i in range(m):
	s1 = s1 + '#'
for i in range(m - 1):
	s2 = s2 + '.'
for i in range(m - 1):
	s3 = '.' + s3
for i in range(1, n + 1):
	if i % 2 != 0:
		print(s1)
	else:
		t = i // 2
		if t % 2 != 0:
			print(s3)
		else:
			print(s2)


(n, m) = list(map(int, input().split()))
left = False
space = '.' * (m - 1)
for i in range(n):
	if i % 2:
		if left:
			print('#{}'.format(space))
			left = False
		else:
			print('{}#'.format(space))
			left = True
	else:
		print('#' * m)


(n, m) = [int(i) for i in input().split()]
last = True
for i in range(n):
	s = ''
	for j in range(m):
		if i % 2 == 0:
			s += '#'
		elif last and j == m - 1 or (not last and j == 0):
			s += '#'
		else:
			s += '.'
	if i % 2 == 1:
		last = not last
	print(s)


(n, m) = map(int, input().split())
k = 1
if n % 2 != 0:
	for i in range(n):
		for j in range(m):
			if i % 2 != 0 and k % 2 == 0:
				print('#' + '.' * (m - 1))
				k += 1
				break
			elif i % 2 != 0 and k % 2 != 0:
				print('.' * (m - 1) + '#')
				k += 1
				break
			else:
				print('#' * m)
				break
else:
	print('n - chet')


def h(m):
	for i in range(m):
		print('#', end='')
	print()

def dh(m):
	for i in range(m - 1):
		print('.', end='')
	print('#')

def hd(m):
	print('#', end='')
	for i in range(m - 1):
		print('.', end='')
	print()
(n, m) = map(int, input().split())
l = 0
for i in range(1, n, 2):
	h(m)
	if l % 2 == 0:
		dh(m)
	else:
		hd(m)
	l = l + 1
h(m)


import sys
(n, m) = map(int, sys.stdin.readline().split())
line0 = '#' * m
line1 = '.' * (m - 1) + '#'
line2 = '#' + '.' * (m - 1)
k = 0
for i in range(n):
	if i % 2 == 0:
		print(line0)
	elif k % 2 == 0:
		print(line1)
		k += 1
	else:
		print(line2)
		k += 1


import sys
import math
(n, m) = map(int, input().split())
a = 1
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif a % 2 != 0:
		print('.' * (m - 1), end='')
		print('#')
		a += 1
	else:
		print('#', end='')
		print('.' * (m - 1))
		a += 1


(n, m) = [int(i) for i in input().split()]
a = ''
b = ''
for i in range(0, m):
	a += '#'
for i in range(1, m):
	b += '.'
for i in range(1, n + 1):
	if i % 2 == 1:
		print(a)
	else:
		k = int(i / 2)
		if k % 2 == 1:
			print(b + '#')
		else:
			print('#' + b)


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def no():
	print('NO')
	return

def yes():
	print('YES')
	return

def solve(case_no):
	(n, m) = map(int, input().split())
	for i in range(1, n + 1):
		for j in range(1, m + 1):
			if i % 2 == 1:
				print('#', end='')
			elif i % 4 == 2 and j == m:
				print('#', end='')
			elif i % 4 == 0 and j == 1:
				print('#', end='')
			else:
				print('.', end='')
		print()
t = 1
for i in range(1, t + 1):
	solve(i)


(n, m) = map(int, input().split(' '))
odd = '#' * m
even = '.' * (m - 1) + '#'
count = 1
line_count = 0
while line_count < n:
	for i in range(1, n + 1):
		print(odd)
		line_count += 1
		if line_count < n:
			if count % 2 == 0:
				print(even[::-1])
			else:
				print(even)
			line_count += 1
		else:
			break
		count += 1


x = input().split()
y = int(x[0])
z = int(x[1])
m1 = '#' * z
n1 = '.' * (z - 1) + '#'
m2 = '#' * z
n2 = '#' + '.' * (z - 1)
if y % 4 == 0:
	k = y // 4
	i = 0
	while i < k:
		print(m1)
		print(n1)
		print(m2)
		print(n2)
		i += 1
else:
	k = y // 4
	i = 0
	while i < k:
		print(m1)
		print(n1)
		print(m2)
		print(n2)
		i += 1
	if y % 4 == 3:
		print(m1)
		print(n1)
		print(m2)
	elif y % 4 == 2:
		print(m1)
		print(n1)
	elif y % 4 == 1:
		print(m1)


(n, m) = str(input()).split()
n = int(n)
m = int(m)
for i in range(n):
	temp_str = str()
	if i % 4 == 1:
		for j in range(m - 1):
			temp_str += '.'
		temp_str += '#'
	elif i % 4 == 3:
		temp_str += '#'
		for j in range(m - 1):
			temp_str += '.'
	else:
		temp_str += '#' * m
	print(temp_str)


def get_numlist():
	list_in = list(input().split())
	list_out = []
	for k in list_in:
		list_out += [int(k)]
	return list_out

def head(a):
	str1 = '#' + '.' * (a - 1)
	return str1

def tail(a):
	str1 = '.' * (a - 1) + '#'
	return str1

def body(a):
	str1 = '#' * a
	return str1

def main():
	list0 = get_numlist()
	check = True
	a = list0[1]
	for i in range(list0[0]):
		if i == 0 or i % 2 == 0:
			print(body(a))
		elif check:
			print(tail(a))
			check = False
		else:
			print(head(a))
			check = True
main()


(n, m) = map(int, input().split())
s = []
for i in range(n):
	if i % 2 == 0:
		s.append('#' * m)
	elif i % 4 == 1:
		s.append('.' * (m - 1) + '#')
	else:
		s.append('#' + '.' * (m - 1))
print('\n'.join(s))


(n, m) = map(int, input().split())
odd = 0
for i in range(n):
	ans = ''
	if i % 2 == 0:
		for j in range(m):
			ans += '#'
	else:
		odd += 1
		for j in range(m):
			if odd % 2 == 1 and j == m - 1:
				ans += '#'
			elif odd % 2 == 0 and j == 0:
				ans += '#'
			else:
				ans += '.'
	print(ans)


nums = [int(x) for x in input().split()]
(r, c) = (nums[0], nums[1])
state = True
for i in range(1, r + 1):
	if i % 2 != 0:
		print('#' * c)
	elif state:
		print('.' * (c - 1) + '#')
		state = False
	else:
		print('#' + '.' * (c - 1))
		state = True


(n, m) = map(int, input().split())
list_1 = ['#'] * m
list_2 = ['.'] * (m - 1) + ['#']
for i in range(1, n + 1):
	if i % 2 != 0:
		print(''.join(list_1))
	else:
		print(''.join(list_2))
		list_2.reverse()


(n, m) = map(int, input().split())
s = m * '#'
s1 = (m - 1) * '.' + '#'
s2 = '#' + (m - 1) * '.'
for i in range(n):
	if i % 2 == 0:
		print(s)
	elif i % 4 == 1:
		print(s1)
	else:
		print(s2)


mat = [int(n) for n in input().split()]
is_right = True
for i in range(1, mat[0] + 1):
	if i % 2 == 0:
		if is_right:
			print('.' * (mat[1] - 1) + '#')
			is_right = False
		else:
			print('#' + '.' * (mat[1] - 1))
			is_right = True
	else:
		print('#' * mat[1])


[n, m] = [int(a) for a in input().split(' ')]
l = '#' * m
l1 = '.' * (m - 1) + '#'
l2 = '#' + '.' * (m - 1)
snake = l
while n > 0:
	snake = snake + '\n' + l
	n = n - 1
	if n > 0:
		snake = snake + '\n' + l1
		n = n - 1
	if n > 0:
		snake = snake + '\n' + l
		n = n - 1
	if n > 0:
		snake = snake + '\n' + l2
		n = n - 1
snake = snake[m:]
print(snake[m - (m - 1):])


n = input()
a = []
a = n.split(' ')
l = int(a[1])
m = int(a[0])

def p(q):
	if q - q // 4 * 4 == 1:
		for i in range(l - 1):
			print('#', end='')
		print('#')
	if q - q // 4 * 4 == 2:
		for j in range(l - 1):
			print('.', end='')
		print('#')
	if q - q // 4 * 4 == 3:
		for k in range(l - 1):
			print('#', end='')
		print('#')
	if q % 4 == 0:
		print('#', end='')
		for v in range(l - 2):
			print('.', end='')
		print('.')
for s in range(1, m + 1):
	p(s)


(n, m) = map(int, input().split())
c = n // 2 + 2
c1 = n - c
a = ['#'] * m
b = ['.'] * (m - 1) + ['#']
b1 = ['#'] + ['.'] * (m - 1)
count = 0
while count < n:
	print(''.join(a))
	count += 1
	if count == n:
		break
	print(''.join(b))
	count += 1
	if count == n:
		break
	print(''.join(a))
	count += 1
	if count == n:
		break
	print(''.join(b1))
	count += 1
	if count == n:
		break


(n, m) = [int(i) for i in input().split()]
first_even = True
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(m):
			print('#', end='')
		print()
	if i % 2 == 0 and first_even:
		for k in range(m - 1):
			print('.', end='')
		print('#')
		first_even = False
	elif i % 2 == 0:
		print('#', end='')
		for k in range(m - 1):
			print('.', end='')
		print()
		first_even = True


(x, y) = [int(a) for a in input().split()]
a = 0
for i in range(1, x + 1):
	if i % 2 != 0:
		print(y * '#')
		a += 1
	elif i % 2 == 0 and a % 2 != 0:
		print('.' * (y - 1) + '#')
	else:
		print('#' + '.' * (y - 1))


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 == 1:
		for x in range(1, m + 1):
			if x != m:
				print('#', end='')
			else:
				print('#')
	if i % 2 == 0:
		if i % 4 == 0:
			for z in range(1, m + 1):
				if z == 1:
					print('#', end='')
				if z == m:
					print('.')
				if z > 1 and z < m:
					print('.', end='')
		else:
			for y in range(1, m + 1):
				if y == m:
					print('#')
				else:
					print('.', end='')


(a, b) = map(int, input().split())
l1 = []
l2 = []
for i in range(a):
	s = ''
	if i & 1 == 0:
		s += '#' * b
	else:
		s += '.' * (b - 1)
		s += '#'
	l1.append(s)
for i in range(len(l1)):
	if i % 4 == 1:
		print(l1[i])
	elif i % 4 == 3:
		a = l1[i][::-1]
		print(a)
	else:
		print(l1[i])


x = list(map(int, input().split()))
a = '#' * x[1]
b = '.' * (x[1] - 1) + '#'
k = [a, b, a, b[::-1]]
j = 0
for i in range(x[0]):
	print(k[j])
	j = j + 1
	if j > 3:
		j = 0


(n, m) = [int(elem) for elem in input().split()]
arr = ['.'] * n
for i in range(n):
	arr[i] = ['.'] * m
for i in range(1, n + 1):
	if i % 4 == 0:
		arr[i - 1][0] = '#'
	elif i % 2 == 0:
		arr[i - 1][-1] = '#'
	else:
		for j in range(m):
			arr[i - 1][j] = '#'
for i in range(n):
	print(''.join(arr[i]))


import sys

def main():
	sys_in = sys.stdin
	sys_out = sys.stdout
	(n, m) = map(int, sys_in.readline().split())
	flag = False
	for i in range(n):
		if i % 2 != 0:
			if not flag:
				sys_out.write(f"{'.' * (m - 1)}{'#'}\n")
				flag = True
			else:
				sys_out.write(f"{'#'}{'.' * (m - 1)}\n")
				flag = False
		else:
			sys_out.write(f"{'#' * m}\n")
main()


def inpNum():
	return int(input())

def inpNums():
	return map(int, input().split())

def inpList():
	return list(map(int, input().split()))
(n, m) = inpNums()
rev = True
for i in range(n):
	if i % 2 == 0:
		print(''.join(['#'] * m))
	else:
		s = '#' + ''.join(['.'] * (m - 1))
		if rev:
			print(s[::-1])
		else:
			print(s)
		rev = not rev


class solution:

	def answer(c, r):
		col = '.'
		row = '#'
		count = 0
		no = c - 1
		num = 0
		lis = []
		for i in range(no):
			if no != 0:
				if num % 2 == 0:
					lis.append(r * row)
					lis.append((r - 1) * col + '#')
					no -= 2
					num += 1
				else:
					lis.append(r * row)
					lis.append('#' + (r - 1) * col)
					no -= 2
					num += 1
		lis.append(r * row)
		return lis
(c, r) = input().split()
ans = solution.answer(int(c), int(r))
for i in ans:
	print(i)


(a, b) = map(int, input().split())
flag = 'R'
for i in range(a):
	if i % 2 == 0:
		print('#' * b)
	elif flag == 'R':
		print('.' * (b - 1) + '#')
		flag = 'L'
	else:
		print('#' + '.' * (b - 1))
		flag = 'R'


(n, m) = input().split()
n = int(n)
m = int(m)
a = '#'
b = '.'
flag = 0
for i in range(n):
	if i % 2 == 0:
		flag += 1
	print((i + 1) % 2 * m * a + flag % 2 * i % 2 * ((m - 1) * b + a) + (flag + 1) % 2 * i % 2 * (a + (m - 1) * b))


(a, b) = map(int, input().split())
m = []
for i in range(a):
	if i % 2 == 1:
		m.append(i)
for i in range(a):
	if i % 2 == 0:
		for j in range(b):
			print('#', end='')
	elif m.index(i) % 2 == 0:
		for j in range(b):
			if j == b - 1:
				print('#', end='')
			else:
				print('.', end='')
	else:
		for j in range(b):
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
	print()


def main():
	(a, b) = list(map(int, input().split()))
	for i in range(a):
		if i % 2 == 0:
			print('#' * b)
		elif i % 4 == 1:
			print('.' * (b - 1) + '#')
		elif i % 4 == 3:
			print('#' + '.' * (b - 1))
main()


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
(n, m) = zz()
f1 = '#' * m
f2 = '.' * (m - 1) + '#'
f3 = '#' + '.' * (m - 1)
c = 0
for i in range(n):
	if i % 2 == 0:
		print(f1)
	elif c == 0:
		print(f2)
		c = 1
	else:
		print(f3)
		c = 0


(n, m) = [int(i) for i in input().split()]
L = []
i = True
for _ in range(n):
	if _ % 2 == 0:
		L.append('#' * m)
	elif i:
		i = False
		L.append('.' * (m - 1) + '#')
	else:
		i = True
		L.append('#' + '.' * (m - 1))
for i in L:
	print(i)


(n, m) = [int(i) for i in input().split()]
l = [[0 for x in range(m)] for y in range(n)]
for j in range(n):
	if j % 2 == 0:
		for a in range(m):
			l[j][a] = '#'
	elif j % 4 == 1:
		for b in range(m - 1):
			l[j][b] = '.'
		l[j][m - 1] = '#'
	else:
		for c in range(1, m):
			l[j][c] = '.'
		l[j][0] = '#'
	p = [0] * m
	for k in range(m):
		p[k] = l[j][k]
	print(''.join(p))


a = []
(n, m) = [int(i) for i in input().split()]
q = 1
for i in range(n):
	if q == 5:
		q = 1
	if q == 1 or q == 3:
		a.append(m * '#')
		q += 1
	elif q == 2:
		a.append((m - 1) * '.' + '#')
		q += 1
	elif q == 4:
		a.append('#' + (m - 1) * '.')
		q += 1
for i in range(n):
	print(a[i])


(a, b) = input().split()
cnt = 0
for i in range(int(a)):
	if i % 2 == 0:
		print(int(b) * '#')
	else:
		cnt += 1
		if cnt % 2 != 0:
			print((int(b) - 1) * '.' + '#')
		else:
			print('#' + (int(b) - 1) * '.')


(n, m) = [int(x) for x in input().split()]
x = 0
y = 0
for i in range(1, n + 1):
	if i % 4 == 1 or i % 4 == 3:
		while x < m - 1:
			print('#', end='')
			x = x + 1
		if x == m - 1:
			print('#')
			x = 0
	elif i % 4 == 2:
		while y < m - 1:
			print('.', end='')
			y = y + 1
		if y == m - 1:
			print('#')
			y = 0
	elif i % 4 == 0:
		print('#', end='')
		y = 1
		while y < m - 1:
			print('.', end='')
			y = y + 1
		if y == m - 1:
			print('.')
			y = 0


from sys import stdin
(n, m) = [int(x) for x in stdin.readline().strip().split()]
m -= 1
for i in range(1, n + 1):
	if i % 4 == 0:
		print('#' + str('.' * m))
	elif i % 2 == 0:
		print(str('.' * m) + '#')
	else:
		print('#' * (m + 1))


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math

def solve():
	(n, m) = map(int, input().split())
	a = []
	flag = 0
	for i in range(n):
		if i % 2 == 0:
			b = ['#' for x in range(m)]
			a.append(b)
		else:
			b = ['.' for x in range(m)]
			if flag == 0:
				b[-1] = '#'
				flag = 1
			else:
				b[0] = '#'
				flag = 0
			a.append(b)
	for x in a:
		for y in x:
			print(y, end='')
		print()
for _ in range(1):
	solve()


inp = input().split()
for i in range(len(inp)):
	inp[i] = int(inp[i])
for i in range(1, inp[0] + 1):
	if i % 2 != 0:
		for j in range(1, inp[1] + 1):
			print('#', end='')
	elif i // 2 % 2 != 0:
		for j in range(inp[1] - 1):
			print('.', end='')
		print('#', end='')
	else:
		print('#', end='')
		for j in range(inp[1] - 1):
			print('.', end='')
	print('')


n = input()
l = n.split(' ')
s = []
r = int(l[0])
c = int(l[1])
a = 1
k = []
for i in range(r):
	w = list()
	for j in range(c):
		if i % 2 == 0:
			w.append('#')
		elif i % 2 != 0:
			if a == 1:
				if j != c - 1:
					w.append('.')
				elif j == c - 1:
					w.append('#')
					a = 0
					continue
			if a == 0:
				if j == 0:
					w.append('#')
				elif j != c - 1:
					w.append('.')
				elif j == c - 1:
					w.append('.')
					a = 1
	s.append(w)
for i in range(r):
	for j in range(c):
		print(s[i][j], end='')
	print()


inp = tuple(map(int, input().split()))
row = inp[0]
col = inp[1]
if row % 2 == 0:
	exit(0)
if row not in range(3, 51) or col not in range(3, 51):
	exit(0)
isR = True
for r in range(0, row):
	s = ''
	isP = False
	for c in range(0, col):
		if r % 2 == 0:
			s += '#'
		elif isR and c == col - 1 and (isP == False):
			s += '#'
			isR = False
		elif isR == False and c == 0:
			s += '#'
			isR = True
			isP = True
		else:
			s += '.'
	print(s)


(a, b) = [int(i) for i in input().split()]
line = '#' * b
line_2 = '.' * (b - 1) + '#'
line_3 = '#' + '.' * (b - 1)
for i in range(a):
	if i % 2 == 0:
		print(line)
	elif i // 2 % 2 == 0:
		print(line_2)
	else:
		print(line_3)


(a, b) = input('').split(' ')
n = int(a)
m = int(b)
x = '#' * m
y = '.' * (m - 1) + '#'
z = '#' + '.' * (m - 1)
for k in range(1, n + 1):
	if k % 2 != 0:
		print(x)
	elif k % 4 == 0:
		print(z)
	elif k % 4 == 2:
		print(y)


f = lambda : input()
(n, m) = map(int, f().split())
odd_count = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print('#', end='', flush=True)
		print('')
	else:
		odd_count += 1
		if odd_count % 2 == 0:
			print('#', end='', flush=True)
			for j in range(m - 1):
				print('.', end='', flush=True)
			print('')
		else:
			for j in range(m - 1):
				print('.', end='', flush=True)
			print('#', end='', flush=True)
			print('')


(x, y) = [int(i) for i in input().split()]
times = 0
snakeHang = 0
for i in range(0, x):
	if times % 2 == 0:
		print('#' * y)
	else:
		if snakeHang % 2 == 0:
			print(str('.' * (y - 1) + '#'))
		else:
			print(str('#' + '.' * (y - 1)))
		snakeHang += 1
	times += 1


(n, m) = map(int, input().split())
arr = [[0] * m for i in range(n)]
for i in range(n):
	for j in range(m):
		arr[i][j] = '.'
i = 0
while i < n:
	for j in range(m):
		arr[i][j] = '#'
	i += 2
for i in range(1, n, 4):
	arr[i][m - 1] = '#'
for i in range(3, n, 4):
	arr[i][0] = '#'
for i in range(n):
	print(*arr[i], sep='')


a = list(map(int, input().split()))
k = 1
while k <= a[0]:
	if k % 4 == 1:
		for i in range(a[1]):
			print('#', end='')
		k += 1
		print('')
	elif k % 4 == 2:
		for i in range(a[1] - 1):
			print('.', end='')
		print('#')
		k += 1
	elif k % 4 == 3:
		for i in range(a[1]):
			print('#', end='')
		print('')
		k += 1
	elif k % 4 == 0:
		print('#', end='')
		for i in range(a[1] - 1):
			print('.', end='')
		print('')
		k += 1


line = input().split(' ')
n = nn = int(line[0])
m = mm = int(line[1])
count = 0
turn = 0
ans = 0
while ans < n:
	s1 = ''
	if ans % 2 == 0:
		times = m
		while times > 0:
			s1 += '#'
			times = times - 1
		print(s1)
		ans += 1
		s1 = ''
	elif ans % 2 == 1:
		if turn % 2 == 0:
			times = m - 1
			while times > 0:
				s1 += '.'
				times = times - 1
			s1 += '#'
			turn += 1
		elif turn % 2 == 1:
			s1 += '#'
			times = m - 1
			while times > 0:
				s1 += '.'
				times = times - 1
			turn += 1
		print(s1)
		ans += 1


(n, m) = map(int, input().split())
mat = []
for i in range(n):
	a = []
	for j in range(m):
		a.append('.')
	mat.append(a)
for row in range(n):
	for col in range(m):
		if row % 2 == 0:
			mat[row][col] = '#'
c = 0
for row in range(1, n, 2):
	if c % 2 == 0:
		mat[row][-1] = '#'
		c += 1
	else:
		mat[row][0] = '#'
		c += 1
for rows in range(n):
	for colm in range(m):
		print(mat[rows][colm], end='')
	print()


n = input()
(n, m) = n.split(' ')
odd_r = ['#'] * int(m)
even_r = ['.'] * (int(m) - 1)
even_rt = 0
for x in range(1, int(n) + 1):
	if x % 2 != 0:
		print(''.join(odd_r))
	else:
		even_rt += 1
		if even_rt % 2 != 0:
			print(''.join(even_r) + '#')
		else:
			print('#' + ''.join(even_r))


(n, m) = map(int, input().split())
l = []
for i in range(1, n + 1):
	s = ''
	for j in range(1, m + 1):
		if i % 2 != 0:
			s += '#'
		elif i % 2 == 0 and i % 4 != 0:
			if j == m:
				s += '#'
			else:
				s += '.'
		elif i % 4 == 0:
			if j == 1:
				s += '#'
			else:
				s += '.'
	l.append(s)
for e in l:
	print(e)


(n, m) = list(map(int, input().strip().split(' ')))
res = []
flag = 0
for i in range(1, n + 1):
	a = []
	if i % 2 != 0:
		a = ['#' for i in range(m)]
	elif flag == 0:
		a = ['.' for i in range(m - 1)]
		a.append('#')
		flag = 1
	else:
		a = ['.' for i in range(m - 1)]
		a.insert(0, '#')
		flag = 0
	for i in a:
		print(i, end='')
	print()


a = [int(i) for i in input().split()]
n = a[0]
multiply = a[1]
t1 = str('#')
s1 = t1 * multiply
t2 = str('.')
s2 = t2 * (multiply - 1) + '#'
s3 = '#' + t2 * (multiply - 1)
flag = 1
for i in range(1, n + 1):
	if i % 2 != 0:
		print(s1)
	elif flag == 1:
		print(s2)
		flag = 0
	else:
		print(s3)
		flag = 1


(n, m) = [int(i) for i in input().split()]
data = ['#' * (m - 1) + '#' if i % 2 == 0 else '.' * (m - 1) + '#' for i in range(n)]
res = []
has_turned = False
for i in range(len(data)):
	if i % 2 != 0:
		tmp = data[i] if not has_turned else data[i][::-1]
		res.append(tmp)
		has_turned = True if not has_turned else False
	else:
		res.append(data[i])
print('\n'.join(res))


(n, m) = list(map(int, input().split()))
chk = True
while n:
	if n % 2 == 1:
		print('#' * m)
	if n % 2 == 0:
		if chk:
			print('.' * (m - 1) + '#')
			chk = False
		elif chk == False:
			print('#' + '.' * (m - 1))
			chk = True
	n = n - 1


def draw(A):
	Snake = ''
	for r in range(1, A[0] + 1):
		if r % 2 == 1:
			Snake = Snake + '#' * A[1]
		elif r % 4 == 0:
			Snake = Snake + '#' + '.' * (A[1] - 1)
		else:
			Snake = Snake + '.' * (A[1] - 1) + '#'
		print(Snake)
		Snake = ''
A = list(map(int, input().split()))
draw(A)


a = list(map(int, input().split()))
for r in range(1, a[0] + 1):
	d = ''
	if r % 4 == 0:
		d = '#'
		for i in range(0, a[1] - 1):
			d += '.'
		print(d)
	elif r % 2 == 0:
		for i in range(0, a[1] - 1):
			d = d + '.'
		print(d + '#')
	else:
		for i in range(0, a[1]):
			d = d + '#'
		print(d)


(n, m) = [int(i) for i in input().split()]
ch = 0
for i in range(n):
	if i % 2 == 0:
		print(m * '#')
	elif ch == 0 and i < n:
		print((m - 1) * '.' + '#')
		ch = 1
	else:
		print('#' + (m - 1) * '.')
		ch = 0


(n, m) = [int(i) for i in input().split()]
var = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif var:
		print('.' * (m - 1) + '#')
		var = False
	else:
		print('#' + '.' * (m - 1))
		var = True


(n, m) = map(int, input().split())
i = 1
while i <= n:
	print(m * '#')
	if i + 1 <= n:
		print((m - 1) * '.', '#', sep='')
	if i + 2 <= n:
		print(m * '#')
	if i + 3 <= n:
		print('#', (m - 1) * '.', sep='')
	i += 4


x = input()
x = x.split()
a = int(x[0])
b = int(x[1])
s = ''
c = 0
for i in range(a):
	s = ''
	if i % 2 == 0:
		c += 1
	for j in range(b):
		if i % 2 == 0:
			s += '#'
		elif j == b - 1:
			s += '#'
		else:
			s += '.'
	if c % 2 == 0:
		print(s[::-1])
	else:
		print(s)


(n, m) = map(int, input().split())
count = 0
if n % 2 == 1 and (n >= 3 and n <= 50) and (m >= 3 and m <= 50):
	for stout in range(n):
		if stout % 2 == 0:
			print('#' * m)
		elif count % 2 == 0:
			print('.' * (m - 1) + '#')
			count += 1
		else:
			print('#' + '.' * (m - 1))
			count += 1
else:
	pass


(n, m) = input().split()
n = int(n)
m = int(m)
sn = ['#'] * m
sn1 = ['.'] * (m - 1)
sn1.append('#')
sn2 = ['#']
sn2 = sn2 + ['.'] * (m - 1)
sns = ''.join(map(str, sn))
sns1 = ''.join(map(str, sn1))
sns2 = ''.join(map(str, sn2))
(r, l) = (1, 0)
for i in range(n):
	if i % 2 == 0:
		print(sns)
	elif r > l:
		print(sns1)
		l += 1
	else:
		print(sns2)
		r += 1


n = [int(x) for x in input().split(' ')]
count = 1
for i in range(n[0]):
	if i % 2 == 1:
		if count % 2 == 1:
			print('.' * (n[1] - 1) + '#')
		else:
			print('#' + '.' * (n[1] - 1))
		count += 1
	else:
		print('#' * n[1])


import math
import os
import sys
import re
import string
import itertools
import functools
import operator
(n, m) = map(int, input().split())
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i % 4 == 1:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))


(n, m) = map(int, input().split())
ans = [['.'] * m for _ in range(n)]
for i in range(n):
	if i % 2 == 0:
		ans[i] = ['#'] * m
	elif i % 4 == 1:
		ans[i][m - 1] = '#'
	elif i % 4 == 3:
		ans[i][0] = '#'
for j in range(n):
	print(''.join(ans[j]))


(c, m) = map(int, input().split())
flag = 1
for i in range(c):
	arr = []
	if i % 2 != 0:
		if flag:
			arr = ['.' for j in range(m - 1)]
			arr.append('#')
			flag = 0
		else:
			arr = ['.' for j in range(m - 1)]
			arr.insert(0, '#')
			flag = 1
		print(''.join(arr))
	else:
		arr = ['#' for j in range(m - 1)]
		arr.append('#')
		print(''.join(arr))


(n, m) = [int(s) for s in input().split()]
a = [['#'] * m for i in range(n)]
for i in range(1, n, 2):
	if (i + 1) % 4 == 0:
		c = 1
	else:
		c = 0
	for j in range(m - 1):
		a[i][j + c] = '.'
for ii in a:
	print(''.join([s for s in ii]))


(a, b) = input().split()
(a, b) = (int(a), int(b))
n = 1
for i in range(a):
	if n == 1 or n == 3:
		print(b * '#', sep='')
		n += 1
	elif n == 2:
		print((b - 1) * '.', '#', sep='')
		n += 1
	else:
		print('#', (b - 1) * '.', sep='')
		n = 1


(n, m) = input().split(None, 1)
(n, m) = (int(n), int(m))
str1 = ''.join(['#' for i in range(m)])
u = ['.' for i in range(m)]
u[-1] = '#'
str2 = ''.join(u)
u[-1] = '.'
u[0] = '#'
str3 = ''.join(u)
for i in range(n):
	if not i % 2:
		print(str1)
	elif i % 4 == 1:
		print(str2)
	else:
		print(str3)


(height, width) = map(int, input().split(' '))
index = width - 1
for i in range(height):
	line = ''
	if i % 2 != 0:
		if index == 0:
			line = '#' + '.' * (width - 1)
			index = width - 1
		else:
			line = '.' * (width - 1) + '#'
			index = 0
	else:
		line = '#' * width
	print(line)


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	else:
		p = '.' * (m - 1)
		if i in [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50]:
			print(p + '#')
		else:
			print('#' + p)


(n, m) = [int(n) for n in input().split()]
tmp = -1
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			print('#', end='')
		print('#')
	if i % 2 != 0:
		for j in range(m):
			if tmp == 1 and j == 0:
				print('#', end='')
				continue
			if tmp == -1 and j == m - 1:
				print('#', end='')
				continue
			print('.', end='')
		tmp = tmp * -1
		print()


def solve(n, m):
	ans = [['.' for _ in range(m)] for _ in range(n)]
	x = 0
	y = 0
	d = 1
	while x < n:
		if d:
			while y < m:
				ans[x][y] = '#'
				y += 1
			y -= 1
			x += 1
			if x >= n:
				break
			ans[x][y] = '#'
			x += 1
			d = 0
		else:
			while y >= 0:
				ans[x][y] = '#'
				y -= 1
			y += 1
			x += 1
			if x >= n:
				break
			ans[x][y] = '#'
			x += 1
			d = 1
	return '\n'.join([''.join(r) for r in ans])

def main():
	(n, m) = list(map(int, input().split()))
	print(solve(n, m))
main()


def main():
	(n, m) = map(int, input().split())
	A = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
	ans = (A[i % 4] for i in range(n))
	print(*ans, sep='\n')
main()


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
(height, width) = map(int, f_input().split())
for i in range(1, height + 1):
	if i % 2 == 1:
		f_print('#' * width + '\n')
	elif i % 4 == 0:
		f_print('#' + '.' * (width - 1) + '\n')
	else:
		f_print('.' * (width - 1) + '#\n')


nm = input().split()
for i in range(int(nm[0])):
	if i % 2 == 0:
		print(int(nm[1]) * '#')
	if i % 4 == 1:
		print((int(nm[1]) - 1) * '.' + '#')
	if i % 4 == 3:
		print('#' + (int(nm[1]) - 1) * '.')


(n, m) = map(int, input().split())
s = '.' * (m - 1)
i = 1
f = True
while i < n:
	print('#' * m)
	if f:
		print(s + '#')
		f = False
	else:
		print('#' + s)
		f = True
	i += 2
print('#' * m)


def print_list(s):
	for i in s:
		print(i, end='')
	print('')
(n, m) = map(int, input().split(' '))
s1 = ['#' for i in range(m)]
s2 = ['.' for i in range(m - 1)]
arr = []
for i in range(n):
	if i % 2 == 0:
		print_list(s1)
	elif i // 2 % 2 == 1:
		print_list(['#'] + s2)
	else:
		print_list(s2 + ['#'])


nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
ans = ''
r = True
l = False
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif r == True:
		print('.' * (m - 1) + '#')
		r = False
		l = True
	elif l == True:
		print('#' + '.' * (m - 1))
		r = True
		l = False


(r, c) = map(int, input().split())
grid = [['.' for _ in range(c)] for _ in range(r)]
movingright = True
(i, j) = (0, 0)
while i < r and j < c:
	if movingright:
		while j < c:
			grid[i][j] = '#'
			j += 1
		j = c - 1
		if i + 1 < r:
			grid[i + 1][j] = '#'
		else:
			break
		i += 2
		movingright = False
	else:
		while j >= 0:
			grid[i][j] = '#'
			j -= 1
		j = 0
		if i + 1 < r:
			grid[i + 1][j] = '#'
		else:
			break
		i += 2
		movingright = True
for i in grid:
	for j in i:
		print(j, end='')
	print()


def snake():
	a = input().split()
	i = int(a[0])
	j = int(a[1])
	for k in range(1, i + 1, 1):
		if k % 2 == 0:
			if k / 2 % 2 == 1:
				print('.' * (j - 1) + '#')
				i += 1
			else:
				print('#' + '.' * (j - 1))
				i += 1
		else:
			print('#' * j)
		i += 1
snake()


s = input()
sp = s.find(' ')
r = int(s[:sp])
c = int(s[sp + 1:])
left = False
full = True
for i in range(r):
	if full == True:
		for i1 in range(c):
			print('#', end='')
		print()
		full = False
	elif left == False:
		for i1 in range(c - 1):
			print('.', end='')
		print('#')
		left = True
		full = True
	else:
		print('#', end='')
		for i1 in range(c - 1):
			print('.', end='')
		left = False
		full = True
		print()


n = input().split()
row = int(n[0])
col = int(n[1])
k = 0
for i in range(1, row + 1):
	if i % 2 != 0:
		print('#' * col)
	else:
		k += 1
		if k % 2 != 0:
			s = '.' * (col - 1)
			print(s + '#')
		else:
			q = '.' * (col - 1)
			print('#' + q)


(n, m) = map(int, input().split())
a = []
switch = 1
for i in range(n):
	if i % 2 == 0:
		a.append(['#'] * m)
	elif switch == 1:
		a.append(['.'] * (m - 1) + ['#'])
		switch -= 1
	else:
		a.append(['#'] + ['.'] * (m - 1))
		switch += 1
for i in range(n):
	for j in range(m):
		print(a[i][j], end='')
	print()


(n, m) = map(int, input().split())
lis = []
t = True
for i in range(n):
	if i % 2 == 0:
		lis.append('#' * m)
	elif t == True:
		lis.append('.' * (m - 1) + '#')
		t = False
	else:
		lis.append('#' + '.' * (m - 1))
		t = True
for i in range(n):
	print(lis[i])


(a, b) = list(map(int, input().split()))
for i in range(b):
	print('#', end='')
print()
f = 1
for i in range(a - 2):
	if i % 2 == 0:
		p = 0
		if f == 0:
			f = 1
			p = 1
			print('#', end='')
		for j in range(b - 1):
			print('.', end='')
		if f == 1 and p == 0:
			print('#', end='')
			f = 0
		print()
	else:
		for i in range(b):
			print('#', end='')
		print()
for i in range(b):
	print('#', end='')


(n, m) = map(int, input().split())
a = m * '#'
b = (m - 1) * '.' + '#'
c = '#' + (m - 1) * '.'
l = [a, b, a, c]
for i in range(n):
	print(l[i % 4])


(m, n) = map(int, input().split())
f = True
for i in range(1, m + 1):
	if i % 2 == 0:
		if f is True:
			print('.' * (n - 1) + '#')
			f = False
		if i % 4 == 0:
			print('#' + '.' * (n - 1))
			f = True
	else:
		print('#' * n)


(n, m) = map(int, input().split())
snake = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
for i in range(n):
	print(snake[i % len(snake)])


(n, m) = map(int, input().split(' '))
for Row in range(n):
	if Row % 2 == 0:
		for k in range(m - 1):
			print('#', end='')
		print('#')
	elif Row % 4 == 1:
		for k in range(m - 1):
			print('.', end='')
		print('#')
	elif Row % 4 == 3:
		print('#', end='')
		for k in range(m - 2):
			print('.', end='')
		print('.')


(n, m) = list(map(int, input().split()))
s1 = '#' * m
s2 = '#'.rjust(m, '.')
s3 = '#'.ljust(m, '.')
flag = 0
for i in range(n):
	if i % 2 == 0:
		print(s1)
	else:
		if flag % 2 == 0:
			print(s2)
		else:
			print(s3)
		flag += 1


(n, m) = map(int, input().split())
flag = True
flag1 = True
for i in range(n):
	if flag1 == True:
		print(m * '#')
		flag1 = False
		continue
	if flag1 == False and flag == True:
		print((m - 1) * '.' + '#')
		flag1 = True
		flag = False
		continue
	if flag1 == False and flag == False:
		print('#' + (m - 1) * '.')
		flag1 = True
		flag = True
		continue


(n, m) = [int(i) for i in input().split()]
straightRow = '#' * m
curvedRow = '.' * (m - 1) + '#'
flag = 1
for i in range(0, n):
	if i % 2:
		print(curvedRow[::flag])
		flag = flag * -1
	else:
		print(straightRow)


(n, m) = map(int, input().split())
x = m - 1
for a in range(1, n + 1):
	if a % 2 != 0:
		print('#' * m)
	elif a % 2 == 0:
		if a // 2 % 2 == 1:
			print('.' * x, '#', sep='')
		elif a // 2 % 2 == 0:
			print('#', '.' * x, sep='')


(n, m) = map(int, input().split())
c = 0
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif i % 2 == 0:
		if c % 2 == 0:
			print('#'.rjust(m, '.'))
			c += 1
		else:
			print('#'.ljust(m, '.'))
			c += 1


a = list(map(int, input().split()))
a1 = a[0]
a2 = a[1]
for i in range(1, a1 + 1):
	if i % 2:
		print('#' * a2)
	elif i % 4:
		print('.' * (a2 - 1) + '#')
	else:
		print('#' + '.' * (a2 - 1))


a = tuple(map(int, input().split()))
q = [a[1] * '#', (a[1] - 1) * '.' + '#', a[1] * '#', '#' + (a[1] - 1) * '.']
for i in range(a[0]):
	print(q[i % 4])


l = [int(x) for x in input().split()]
n = l[0]
m = l[1]
s = ''
flag = 0
for i in range(n):
	s = ''
	for j in range(m):
		if i % 2 == 0:
			s = s + '#'
		else:
			if flag == 0 and j != m - 1:
				s = s + '.'
			if flag == 0 and j == m - 1:
				s = s + '#'
				flag = 1
				break
			if flag == 1 and j == 0:
				s = s + '#'
			if flag == 1 and 0 < j < m - 1:
				s = s + '.'
			if flag == 1 and j == m - 1:
				s = s + '.'
				flag = 0
				break
	print(s)


(n, m) = map(int, input().split())
now = 'right'
for i in range(1, n + 1):
	if i % 2 == 0 and now == 'right':
		print((m - 1) * '.' + '#')
		now = 'left'
	elif i % 2 == 0 and now == 'left':
		print('#' + (m - 1) * '.')
		now = 'right'
	else:
		print('#' * m)


(r, c) = map(int, input().split())
l = []
for i in range(r):
	if i % 2 == 0:
		x = '#' * c
	else:
		x = '.' * c
		if (i + 1) % 4 == 0:
			x = '#' + x[1:]
		else:
			x = x[:c - 1] + '#'
	l.append(x)
for i in l:
	print(i)


(m, n) = map(int, input().split())
l1 = []
for i in range(0, m):
	l2 = []
	for j in range(0, n):
		if i == 0 or i % 2 == 0:
			l2.append('#')
		else:
			l2.append('.')
	l1.append(l2)
for i in range(1, m, 4):
	l1[i][n - 1] = '#'
for i in range(3, m, 4):
	l1[i][0] = '#'
for x in l1:
	for y in x:
		print(y, end='')
	print()


(n, m) = map(int, input().split())
s = '#'
x = '.'
k = 0
for i in range(n):
	if i % 2 == 0:
		print(s * m)
		xx = x * (m - 1) + s
		print(xx)
	else:
		print(s * m)
		xx = s + x * (m - 1)
		print(xx)
	if i + 1 == (n - 1) // 2:
		break
print(s * m)


(rows, column) = map(int, input().split())
pat1 = '#' * column
pat2 = '.' * (column - 1) + '#'
for i in range(1, rows + 1):
	if i % 2 != 0:
		print(pat1, end='')
	else:
		print(pat2, end='')
		pat2 = pat2[::-1]
	print('')


(a, b) = input().split(' ')
(a, b) = (int(a), int(b))
i = 1
while i <= a:
	s = 0
	if b >= 2:
		s = i / 2
	if i == 1 or i % 2 != 0:
		print(b * '#')
	elif s % 2 != 0:
		print((b - 1) * '.' + '#')
	else:
		print('#' + (b - 1) * '.')
	i += 1


(n, m) = map(int, input().split())
a = [['.' for j in range(m)] for i in range(n)]
right = 1
for i in range(len(a)):
	if i % 2 == 1 and right == 1:
		a[i][m - 1] = '#'
		right ^= 1
		continue
	elif i % 2 == 1 and right == 0:
		a[i][0] = '#'
		right ^= 1
		continue
	for j in range(len(a[i])):
		a[i][j] = '#'
for i in range(n):
	for j in range(m):
		print(a[i][j], end='')
	print()


(n, m) = map(int, input().split())
flag = 0
for i in range(n):
	a = []
	if i % 2 == 0:
		for k in range(m):
			a.append('#')
		print(''.join(a))
	elif i % 2 == 1 and flag == 0:
		for k in range(m - 1):
			a.append('.')
		a.append('#')
		flag = 1
		print(''.join(a))
	elif i % 2 == 1 and flag == 1:
		a.append('#')
		for k in range(m - 1):
			a.append('.')
		flag = 0
		print(''.join(a))


(n, v) = map(int, input().split())
if 3 <= n and v <= 50:
	for x in range(1, n + 1):
		if x % 4 == 0:
			print('#' + '.' * (v - 1))
		elif x % 2 == 0:
			print('.' * (v - 1) + '#')
		else:
			print('#' * v)


(x, y) = input().split(' ')
(x, y) = (int(x), int(y))
right = 1
for row in range(1, x + 1):
	if row % 2 == 1:
		for col in range(y):
			print('#', end='')
	elif right:
		for col in range(y - 1):
			print('.', end='')
		print('#', end='')
		right = 0
	else:
		print('#', end='')
		for col in range(y - 1):
			print('.', end='')
		right = 1
	print()


(a, b) = map(int, input().split())
for i in range(a):
	if (i + 1) % 4 == 1 or (i + 1) % 4 == 3:
		print('#' * b)
	elif (i + 1) % 4 == 2:
		print('.' * (b - 1) + '#')
	else:
		print('#' + '.' * (b - 1))


(l, h) = [int(x) for x in input().split()]
m = 0
for i in range(l):
	for j in range(h):
		if i % 2 == 0:
			print('#' * h)
			break
		elif i == 1 + 4 * m:
			print('.' * (h - 1) + '#')
			m += 1
			break
		else:
			print('#' + '.' * (h - 1))
			break


(p, q) = map(int, input().split())
s = ''
for i in range(q):
	s += '#'
s1 = ''
s2 = '#'
for i in range(q - 1):
	s1 += '.'
	s2 += '.'
s1 += '#'
i = 0
while i < p:
	print(s)
	i += 1
	if i < p:
		print(s1)
		i += 1
	if i < p:
		print(s)
		i += 1
	if i < p:
		print(s2)
		i += 1


(n, m) = map(int, input().split())
right = 1
for i in range(0, n):
	for j in range(0, m):
		if i % 2 == 0:
			print('#', end='', flush=True)
		elif right and j == m - 1:
			print('#', end='', flush=True)
		elif not right and j == 0:
			print('#', end='', flush=True)
		else:
			print('.', end='', flush=True)
	if i % 2 != 0:
		right = right ^ 1
	print()


(a, b) = input().split()
a = int(a)
b = int(b)
x = 1
c = 0
while x != a + 1:
	if x % 2 != 0:
		print(b * '#')
	elif c == 0:
		print((b - 1) * '.' + 1 * '#')
		c = 1
	else:
		print(1 * '#' + (b - 1) * '.')
		c = 0
	x = x + 1


try:
	(a, b) = list(map(int, input().split()))
	for i in range(1, a + 1):
		if i % 2 != 0:
			print('#' * b)
		if i % 4 == 0:
			print('#', end='')
			print('.' * (b - 1))
		if i % 2 == 0 and i % 4 != 0:
			print('.' * (b - 1), end='')
			print('#')
except:
	pass


(n, m) = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if i & 1:
		for j in range(m):
			print('#', end='')
		print()
	elif i % 4 == 0:
		print('#', end='')
		for j in range(1, m):
			print('.', end='')
		print()
	else:
		for j in range(1, m):
			print('.', end='')
		print('#')


(r, c) = [int(n) for n in input().split()]
r //= 2
for turn in range(r):
	print('#' * c)
	if turn % 2 == 0:
		print('.' * (c - 1) + '#')
	else:
		print('#' + '.' * (c - 1))
print('#' * c)


(line, row) = [int(x) for x in input().split()]
p = [[] for i in range(line)]
for i in range(line):
	for j in range(row):
		if i % 2 == 0:
			p[i].append('#')
		elif i % 4 == 1:
			if j != row - 1:
				p[i].append('.')
			else:
				p[i].append('#')
		elif j == 0:
			p[i].append('#')
		else:
			p[i].append('.')
for i in range(line):
	print(''.join(p[i]))


user_input = input().split()
row = int(user_input[0])
col = int(user_input[1])
x = 0
for i in range(row):
	if i % 2 != 0:
		if x == 0:
			print('.' * (col - 1) + '#')
			x = 1
		else:
			print('#' + (col - 1) * '.')
			x = 0
	else:
		print('#' * col)


b = [int(b) for b in input().split()]
n = b[0]
m = b[1]
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif (i - 1) % 4 == 0 and j == m - 1 or ((i - 1) % 4 != 0 and j == 0):
			print('#', end='')
		else:
			print('.', end='')
	print()


(x, y) = map(int, input().split())
c = 1
for a in range(int((x - 1) / 2)):
	print('#' * y)
	if c % 2 == 1:
		print('.' * (y - 1) + '#')
		c += 1
	else:
		print('#' + '.' * (y - 1))
		c += 1
print('#' * y)


(x, y) = map(int, input().split())
for i in range(0, x):
	i = i % 4
	if i == 0 or i == 2:
		print(y * '#')
	elif i == 1:
		print((y - 1) * '.' + '#')
	elif i == 3:
		print('#' + (y - 1) * '.')


(n, m) = map(int, input().split())
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 1:
			print('#' * m)
			break
		elif i % 2 == 0 and i != 4 and (i % 4 != 0):
			b = '.' * (m - 1)
			print(b + '#')
			break
		else:
			print('#' + b)
			break


inp = input()
inp = inp.split()
n = int(inp[0])
m = int(inp[1])
for i in range(n):
	if i % 4 == 1:
		print(str('.' * (m - 1)) + '#')
	elif i % 4 == 3:
		print('#' + str('.' * (m - 1)))
	else:
		print(str('#' * m))


from re import *
from sys import stderr

def readint():
	return int(input())

def readfloat():
	return float(input())

def readarray(N, foo=input):
	return [foo() for i in range(N)]

def readlinearray(foo=int):
	return map(foo, input().split())
(a, b) = readlinearray()
for i in range(a):
	if i % 2 == 0:
		print('#' * b)
	elif i % 4 == 1:
		print('.' * (b - 1) + '#')
	else:
		print('#' + '.' * (b - 1))


nums = input().split()
val = 1
val2 = 0
lst = []
lst2 = []
for i in range(int(nums[0])):
	for j in range(int(nums[1])):
		lst2.append('.')
	lst.append(lst2)
	lst2 = []
for i in lst:
	if val % 2 != 0:
		for j in enumerate(i):
			i[j[0]] = '#'
		print(''.join(i))
	elif val % 2 == 0:
		if val2 % 2 == 0 or val2 == 0:
			i[-1] = '#'
			val2 += 1
			print(''.join(i))
		else:
			i[0] = '#'
			val2 += 1
			print(''.join(i))
	val += 1


def answer():
	a = input().split()
	n = int(a[0])
	c = int(a[1])
	ans = ''
	i = 1
	while i <= n:
		if i % 2:
			ans += '#' * c
		elif i % 4 == 0:
			ans += '#' + '.' * (c - 1)
		else:
			ans += '.' * (c - 1) + '#'
		if i != n:
			ans += '\n'
		i += 1
	return ans
print(answer())


k = 1
s = ''
z = ''
(n, m) = map(int, input().split())
a = []
for i in range(m):
	s += '.'
for i in range(m):
	z += '#'
for i in range(n):
	a.append(s)
for i in range(n):
	if (i + 1) % 2 == 1:
		a[i] = z
	else:
		if k % 2 == 1:
			a[i] = s[:len(s) - 1] + '#'
		else:
			a[i] = '#' + s[1:]
		k += 1
for i in range(n):
	print(a[i])


(x, y) = map(int, input().strip().split())
f = []
k = 0
for i in range(1, x + 1):
	for j in range(1, y + 1):
		if i % 2 == 0:
			if k == 0:
				r = '.' * (y - 1) + '#'
				f.append(r)
				k = 1
				break
			if k == 1:
				r = '#' + '.' * (y - 1)
				f.append(r)
				k = 0
				break
		else:
			f.append('#' * y)
			break
for i in f:
	print(i)


(n, m) = list(map(int, input().split()))
p1 = '#' * m
p2 = '.' * (m - 1) + '#'
p3 = '#' + '.' * (m - 1)
count = 0
for i in range(n):
	if i == 0 or (i > 1 and i % 2 == 0):
		print(p1)
	elif i == 1 or (i > 1 and i % 2 != 0):
		count += 1
		if count % 2 != 0:
			print(p2)
		else:
			print(p3)


def main():
	(row, col) = map(int, input().split())
	left = True
	for i in range(1, row + 1):
		if i % 2 == 0:
			if left:
				_str = '.' * (col - 1)
				print(_str + '#')
				left = not left
			else:
				_str = '.' * (col - 1)
				print('#' + _str)
				left = not left
		else:
			print('#' * col)
main()


(n, m) = map(int, input().split())
c = '.' * m
for k in range(n):
	print([['#' * m, c[:-1] + '#'][k % 4 % 2], '#' + c[1:]][k % 4 == 3])


(duoshaohang, duoshaolie) = [int(i) for i in input().split()]
for i in range(1, duoshaohang + 1):
	if i % 2 == 1:
		for j in range(duoshaolie - 1):
			print('#', end='')
		print('#')
	else:
		if i % 4 == 2:
			for k in range(duoshaolie - 1):
				print('.', end='')
			print('#')
		if i % 4 == 0:
			print('#', end='')
			for v in range(duoshaolie, 2, -1):
				print('.', end='')
			print('.')


(n, m) = [int(x) for x in input().split()]
h = m - 1
v = 0
for i in range(n):
	print('#' * m)
	v = v + 1
	if v == n:
		break
	if i % 2 == 0:
		print('.' * h + '#')
		v = v + 1
	else:
		print('#' + '.' * h)
		v = v + 1


array = list(map(int, input().split()))
(n, m) = array[0:2]
(temp1, temp2) = ([], [])
for j in range(m - 1):
	temp1.append('#')
	temp2.append('.')
temp1.append('#')
temp1 = ''.join(temp1)
temp2 = ''.join(temp2)
for i in range(n):
	if i % 2 == 0:
		print(temp1)
	elif i % 4 == 1:
		print(temp2 + '#')
	else:
		print('#' + temp2)


from math import *
(n, m) = map(int, input().split())
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 != 0:
			print('#', end='')
		elif ceil(i / 2) % 2 == 0:
			if j == 1:
				print('#', end='')
			else:
				print('.', end='')
		elif j == m:
			print('#', end='')
		else:
			print('.', end='')
	print('')


(n, m) = map(int, input().split())
d = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
r = ''
for i in range(n):
	r += d[i % 4] + '\n'
print(r, end='')


def main():
	(n, m) = map(int, input().split())
	a = '#' * m
	b = '.' * (m - 1) + '#'
	c = a
	d = '#' * 1 + '.' * (m - 1)
	for i in range(n):
		print(a)
		(a, b, c, d) = (b, c, d, a)
main()


nums = [int(x) for x in input().strip().split(' ')]
a = '#'
b = '.'
n = nums[-1]
m = nums[-2]
c = n - 1
d = 3
if m == 3 and n == 3:
	print(a * 3)
	print(b * 2 + a)
	print(a * 3)
elif m == 3 and n > 3:
	print(a * n)
	print(b * c + a)
	print(a * n)
else:
	while d < m:
		print(a * n)
		print(b * c + a)
		print(a * n)
		print(a + b * c)
		d = d + 4
	if d == 7 and m == 7 or (d == 11 and m == 11) or (d == 15 and m == 15) or (d == 19 and m == 19) or (d == 23 and m == 23) or (d == 27 and m == 27) or (d == 31 and m == 31) or (d == 35 and m == 35) or (d == 39 and m == 39) or (d == 43 and m == 43) or (d == 47 and m == 47):
		print(a * n)
		print(b * c + a)
		print(a * n)
	else:
		print(a * n)


reqs = list(map(int, input().rstrip().split()))
n = reqs[0]
m = reqs[1]
lAns = []
for i in range(n):
	if i % 2 == 0:
		pattern = m * '#'
		lAns += [pattern]
	else:
		oddPattern = (m - 1) * '.' + '#'
		if (i - 1) % 4 == 0:
			lAns += [oddPattern]
		else:
			lAns += [oddPattern[::-1]]
print('\n'.join(lAns))


(n, m) = map(int, input().split())
is_full = True
is_right = True
for _ in range(n):
	if is_full:
		print('#' * m)
		is_full = False
	else:
		if is_right:
			print('.' * (m - 1) + '#')
			is_right = False
		else:
			print('#' + '.' * (m - 1))
			is_right = True
		is_full = True


from sys import stdin
_input = stdin.readline
(_range, _int) = (range, int)

def solution():
	(n, k) = [_int(i) for i in _input().split()]
	t = True
	for i in _range(n):
		if i % 2 == 0:
			print('#' * k)
		elif t:
			print('.' * (k - 1) + '#')
			t = False
		else:
			print('#' + '.' * (k - 1))
			t = True
solution()


(tinggi, lebar) = map(int, input().split())
tentu = 0
tentu2 = 1
for z in range(tinggi):
	if tentu2 % 2 == 0:
		if tentu % 2 == 0:
			print('.' * (lebar - 1) + '#')
		else:
			print('#' + '.' * (lebar - 1))
		tentu += 1
		tentu2 += 1
	else:
		print('#' * lebar)
		tentu2 += 1


(n, m) = map(int, input().split())
c = 0
for y in range(0, n):
	if y % 2 == 0:
		print('#' * m)
	elif c == 0:
		print('.' * (m - 1) + '#')
		c += 1
	else:
		print('#' + '.' * (m - 1))
		c -= 1


(n, m) = map(int, input().split())
z = '#' * m
x = '#'.rjust(m, '.')
y = '#'.ljust(m, '.')
i = 0
while i < n:
	print(z)
	i += 1
	if i == n:
		break
	print(x)
	i += 1
	if i == n:
		break
	print(z)
	i += 1
	if i == n:
		break
	print(y)
	i += 1
	if i == n:
		break


def _510A(n, m):
	result = []
	for index in range(1, n + 1):
		if index % 2 == 1:
			result.append('#' * m)
		elif index / 2 % 2 == 0:
			result.append('#' + '.' * (m - 1))
		else:
			result.append('.' * (m - 1) + '#')
	return result
(n, m) = list(map(lambda x: int(x), input().split()))
result = _510A(n, m)
for index in range(n):
	print(result[index])


x = -1
(R, C) = map(int, input().split())
c = C - 1
for i in range(R):
	if i % 2 == 0:
		print('#' * C)
	elif x == -1:
		print('.' * c + '#')
		x += 1
	else:
		print('#' + '.' * c)
		x -= 1


(n, m) = map(int, input().split())
a = []
flag = 1
for i in range(n):
	if i % 2 == 0:
		a.append('#' * m)
	else:
		if flag == 1:
			x = '.' * (m - 1) + '#'
			flag = 0
		else:
			x = '#' + '.' * (m - 1)
			flag = 1
		a.append(x)
for i in range(len(a)):
	print(a[i])


(n, m) = map(int, input().split())
k = 1
for i in range(n):
	if i % 2 == 0:
		print(''.join(['#'] * m))
	elif k:
		print(''.join(['.'] * (m - 1) + ['#']))
		k = 0
	elif k == 0:
		print(''.join(['#'] + ['.'] * (m - 1)))
		k = 1


(n, m) = map(int, input().split())
flag = True
while n:
	if n % 2 != 0:
		print('#' * m)
	elif flag:
		print('#'.rjust(m, '.'))
		flag = False
	else:
		print('#'.ljust(m, '.'))
		flag = True
	n -= 1


(x, y) = [int(i) for i in input().split()]
b = False
m = [['#' if not i % 2 else '.' for j in range(y)] for i in range(x)]
b = False
for i in range(len(m)):
	if i % 2:
		m[i][y - 1 if not b else 0] = '#'
		b = not b
for i in m:
	print(''.join(i))


l = list(map(int, input().split()))
n = l[0]
m = l[1]
count = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			print('#', end='')
		print('#')
	else:
		count += 1
		if count % 2 != 0:
			for k in range(m - 1):
				print('.', end='')
			print('#')
		else:
			print('#', end='')
			for p in range(m - 2):
				print('.', end='')
			print('.')


(n, m) = map(int, input().split())
A = [['.' for i in range(m)] for j in range(n)]
for i in range(len(A)):
	for j in range(len(A[i])):
		if i % 2 == 0:
			A[i][j] = '#'
for i in range(len(A)):
	for j in range(len(A[i])):
		if i % 2 == 1:
			if (i - 1) / 2 % 2 == 0:
				A[i][-1] = '#'
			else:
				A[i][0] = '#'
for i in range(len(A)):
	for j in range(len(A[i])):
		print(A[i][j], end='')
	print()


(r, c) = map(int, input().split())
for row in range(r):
	for col in range(c):
		if row % 2 == 0 or (row % 4 == 1 and col == c - 1) or (row % 4 == 3 and col == 0):
			print('#', end='')
		else:
			print(end='.')
	print()


(n, m) = [int(x) for x in input().split()]
a = []
b = []
c = ['#']
for d in range(m):
	a.append('#')
for e in range(m - 1):
	b.append('.')
b.append('#')
for f in range(m - 1):
	c.append('.')
for i in range(n):
	if i % 2 == 0:
		print(''.join(a))
	elif (i - 1) % 4 == 0:
		print(''.join(b))
	else:
		print(''.join(c))


(n, m) = map(int, input().split())
s1 = '#' * m
s2 = '.' * (m - 1) + '#'
s3 = '#' + '.' * (m - 1)
for i in range(n // 2):
	print(s1)
	if not i % 2:
		print(s2)
	else:
		print(s3)
print(s1)


from sys import stdin

def main():
	(total_lines, line_len) = stdin_get_ints_from_line()
	for line_num in range(total_lines):
		line_type = line_num % 4
		if line_type in (0, 2):
			line = '#' * line_len
		elif line_type == 1:
			line = '.' * (line_len - 1)
			line += '#'
		elif line_type == 3:
			line = '#'
			line += '.' * (line_len - 1)
		print(line)

def stdin_get_ints_from_line():
	return (int(x) for x in stdin.readline().strip().split(' '))

def stdin_get_ints_list_from_line():
	return list((int(x) for x in stdin.readline().strip().split(' ')))

def stdin_get_string_from_line():
	return stdin.readline().strip()
main()


(turns, snakelen) = [int(x) for x in input().split()]
if not turns % 2 or turns < 3 or snakelen > 50:
	exit()
for n in range(1, turns + 1):
	print('#', '.' * (snakelen - 1), sep='') if not n % 4 else print('.' * (snakelen - 1), '#', sep='') if not n % 2 else print('#' * snakelen)


(num1, num2) = [int(i) for i in str(input()).split()]
for i in range(1, num1 + 1):
	if i % 2 == 1:
		print(num2 * '#')
	elif i % 4 == 2:
		print((num2 - 1) * '.' + '#')
	else:
		print('#' + (num2 - 1) * '.')


x = [int(y) for y in input().split()]
s = str()
c = 1
for i in range(1, x[0] + 1):
	if i % 2 == 0:
		k = i // 2
	for j in range(1, x[1] + 1):
		if i % 2 != 0:
			s = s + '#'
		if i % 2 == 0 and j != x[1] and (k % 2 != 0):
			s += '.'
		if i % 2 == 0 and j == x[1] and (k % 2 != 0):
			s += '#'
		if i % 2 == 0 and j == 1 and (k % 2 == 0):
			s += '#'
		if i % 2 == 0 and j != 1 and (k % 2 == 0):
			s += '.'
	s += '\n'
print(s)


(X, Y) = map(int, input().split())
for i in range(1, X + 1):
	if i % 2 != 0:
		for j in range(Y):
			print('#', end='')
	elif i % 2 == 0:
		if i % 4 == 0:
			print('#', end='')
			for j in range(Y - 1):
				print('.', end='')
		else:
			for j in range(Y - 1):
				print('.', end='')
			print('#', end='')
	print('')


a = input('').split(' ')
check = 0
lo1 = ''
lo2 = ''
for val in range(int(a[1])):
	lo1 = lo1 + '#'
for val in range(int(a[1]) - 1):
	lo2 = lo2 + '.'
lo2 = lo2 + '#'
lo3 = '#'
for val in range(int(a[1]) - 1):
	lo3 = lo3 + '.'
for value in range(int(a[0])):
	if check % 2 == 0:
		print(lo1)
		check = check + 1
	elif check % 4 == 1:
		print(lo2)
		check = check + 1
	elif check % 4 == 3:
		print(lo3)
		check = check + 1


(n, m) = map(int, input().split())
ans = [[] for i in range(n)]
for i in range(0, n, 2):
	ans[i] = ['#' for j in range(m)]
ind = -1
for i in range(1, n, 2):
	a = ['.' for i in range(m)]
	a[ind] = '#'
	ans[i] = a
	if ind:
		ind += 1
	else:
		ind -= 1
for i in range(n):
	ans[i] = ''.join(ans[i])
print('\n'.join(ans))


(n, m) = map(int, input().split())
row = ['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)]
N = len(row)
j = 0
for i in range(n):
	if j > N - 1:
		j = 0
		print(row[j])
		j += 1
	else:
		print(row[j])
		j += 1


(r, c) = map(int, input().split())
c1 = 0
for i in range(1, r + 1):
	if i & 1:
		for j in range(c):
			print('#', end='')
		print()
	else:
		c1 += 1
		if c1 & 1:
			for j in range(c):
				if j == c - 1:
					print('#')
				else:
					print('.', end='')
		else:
			for j in range(c):
				if j == 0:
					print('#', end='')
				else:
					print('.', end='')
			print()


(n, m) = list(map(int, input().split()))
print('\n'.join([['#' * m, '.' * (m - 1) + '#', '#' * m, '#' + '.' * (m - 1)][i % 4] for i in range(n)]))


import sys

def geti():
	return map(int, sys.stdin.readline().strip().split())
(n, m) = geti()
k = 1
for i in range(n):
	if i % 2 == 0:
		for _ in range(m):
			print('#', end='')
	elif k % 2:
		for j in range(m):
			if j == m - 1:
				print('#', end='')
			else:
				print('.', end='')
		k += 1
	else:
		for j in range(m):
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
		k += 1
	print()


lst = [int(_) for _ in input().split()]
n = lst[0]
m = lst[1]
fl = 0
for i in range(n):
	for j in range(m):
		if i % 2:
			if j == 0 and fl % 2:
				print('#', end='')
				continue
			if j == m - 1 and (not fl % 2):
				print('#', end='')
				continue
			print('.', end='')
		else:
			print('#', end='')
	if i % 2:
		fl += 1
	print('')


(x, y) = map(int, input().split())
dots_first = True
for i in range(x):
	if i % 2 == 0:
		print('#' * y)
	elif dots_first:
		print('.' * (y - 1), end='')
		print('#')
		dots_first = False
	else:
		print('#', end='')
		print('.' * (y - 1))
		dots_first = True


y_and_x = input().split()
x = int(y_and_x[1])
y = int(y_and_x[0])
dotlines = 0
for j in range(y):
	line = []
	for i in range(x):
		if j % 2 == 1 and i < x - 1 and (dotlines % 2 == 0):
			line.append('.')
		elif j % 2 == 1 and i != 0 and (dotlines % 2 == 1):
			line.append('.')
		else:
			line.append('#')
	if '.' in line:
		dotlines += 1
	print(''.join(line))


(n, m) = map(int, input().split())

def bins(n):
	s = bin(n)
	return '.' * (m + 2 - len(s)) + s[2:].replace('0', '.').replace('1', '#')
for i in range(1, n + 1):
	if i % 2 == 1:
		print(bins(pow(2, m) - 1))
	elif i % 4 == 2:
		print(bins(1))
	else:
		print(bins(pow(2, m - 1)))


(n, m) = map(int, input().split())
img = [['.' for _ in range(m)] for _ in range(n)]
for r in range(n):
	if r % 2 == 0:
		img[r] = ['#'] * m
	else:
		col = -1 if r % 4 == 1 else 0
		img[r][col] = '#'
for row in img:
	print(''.join(row))


(n, m) = input().split()
n = int(n)
m = int(m)
for i in range(1, n + 1):
	if i % 2 != 0:
		x = ['#'] * m
		c = ''
		d = c.join(x)
		print(d)
	elif i % 2 == 0 and i % 4 != 0:
		y = ['.'] * m
		y[len(y) - 1] = '#'
		e = ''
		f = e.join(y)
		print(f)
	elif i % 2 == 0 and i % 4 == 0:
		z = ['.'] * m
		z[0] = '#'
		g = ''
		h = g.join(z)
		print(h)


(n, m) = list(map(int, input().split()))
s1 = ''
s2 = ''
for _ in range(m):
	s1 += '#'
	s2 += '.'
s2 = '#' + s2[1:len(s2)]
s3 = s2[::-1]
for i in range(1, n + 1):
	if i % 2 == 1:
		print(s1)
	elif i % 2 == 0:
		if i % 4 == 0:
			print(s2)
		elif i % 4 != 0:
			print(s3)


ent = str.split(input(), ' ')
y = int(ent[0])
x = int(ent[1])
Matrix = [['.' for x in range(x)] for y in range(y)]
aux = False
for i in range(0, y):
	if i % 2 == 0:
		for j in range(0, x):
			Matrix[i][j] = '#'
	else:
		if aux:
			Matrix[i][0] = '#'
		else:
			Matrix[i][j] = '#'
		aux = not aux
for i in range(0, y):
	print(''.join(Matrix[i][:]))


(n, m) = map(int, input().split())
s1 = '#' * m
s2 = '.' * (m - 1) + '#'
s3 = '#' + s2[:-1]
i = 1
k = 1
while True:
	if i % 2 == 1:
		print(s1)
	else:
		if k % 2 == 0:
			print(s3)
		else:
			print(s2)
		k += 1
	i += 1
	if i > n:
		break


(n, m) = map(int, input().split())
s = ''
x = '#'
c = '#'
for i in range(0, m):
	s += '#'
for i in range(1, m):
	x = x + '.'
for i in range(1, m):
	c = '.' + c
for i in range(0, n):
	if i % 4 == 0 or i % 4 == 2:
		print(s)
	elif i % 4 == 1:
		print(c)
	else:
		print(x)


(m, n) = list(map(int, input().split()))
arr = [['.'] * n for _ in range(m)]
for i in range(0, m, 2):
	for j in range(n):
		arr[i][j] = '#'
c = 1
for i in range(1, m, 2):
	if c % 2 == 1:
		arr[i][n - 1] = '#'
	else:
		arr[i][0] = '#'
	c += 1
for i in arr:
	for j in i:
		print(j, end='')
	print()


(n, m) = map(int, input().split())
s = '#' * m
t = '.' * (m - 1) + '#'
i = 1
while i < n + 1:
	if i % 2 == 1:
		print(s)
	elif i % 2 == 0 and i % 4 != 0:
		print(t)
	else:
		print(t[::-1])
	i += 1


(r, c) = list(map(int, input().split()))
i = 0
v = 1
while i < r:
	if v == 1 or v == 3:
		j = 0
		while j < c:
			print('#', end='')
			j += 1
		print()
		if v == 1:
			v = 2
		else:
			v = 4
	elif v == 2:
		j = 0
		while j < c - 1:
			print('.', end='')
			j += 1
		print('#')
		v = 3
	elif v == 4:
		j = 0
		print('#', end='')
		while j < c - 1:
			print('.', end='')
			j += 1
		print()
		v = 1
	i += 1


(n, m) = map(int, input().split())
for row in range(1, n + 1):
	row_even = row % 2 == 0
	row_odd = row % 2 != 0
	right_switch = row % 4 != 0
	for col in range(1, m + 1):
		if col == m and right_switch and row_even:
			print('#', end='')
		elif col == 1 and (not right_switch) and row_even:
			print('#', end='')
		elif row_even:
			print('.', end='')
		elif row_odd:
			print('#', end='')
	print()


(R, C) = [int(x) for x in input().split()]
longs = '#' * C
shorts = '.' * (C - 1) + '#'
for i in range(R):
	if i % 2 == 0:
		print(longs)
	else:
		print(shorts[::2 - i % 4])


(n, m) = list(map(int, input().strip().split(' ')))
for i in range(n):
	if i & 1 == 0:
		print('#' * m)
	elif (i + 1) % 4 == 0:
		print('#' + '.' * (m - 1))
	else:
		print('.' * (m - 1) + '#')


def seperateints(x):
	k = ''
	l = []
	for i in x:
		if i == ' ':
			l.append(int(k))
			k = ''
			continue
		k = k + i
	l.append(int(k))
	return l

def luckynum(x):
	for i in x:
		if i != '4' and i != '7':
			return False
	return True
l = seperateints(input())
q = 0
ll = []
while len(ll) < l[0]:
	kk = ''
	if len(ll) == 0:
		for k in range(l[1]):
			kk = kk + '#'
		ll.append(kk)
		kk = ''
	for k in range(l[1] - 1):
		kk = kk + '.'
	kk = kk + '#'
	ll.append(kk)
	kk = ''
	if len(ll) == l[0]:
		break
	for k in range(l[1]):
		kk = kk + '#'
	ll.append(kk)
	kk = ''
	if len(ll) == l[0]:
		break
	kk = kk + '#'
	for k in range(l[1] - 1):
		kk = kk + '.'
	ll.append(kk)
	kk = ''
	if len(ll) == l[0]:
		break
	for k in range(l[1]):
		kk = kk + '#'
	ll.append(kk)
	kk = ''
	if len(ll) == l[0]:
		break
for i in ll:
	print(i)


(n, m) = [int(i) for i in input('').split(' ')]
x = n // 4
s = '#' * m + '\n' + '.' * (m - 1) + '#' + '\n' + '#' * m + '\n' + '#' + '.' * (m - 1)
for i in range(x):
	print(s)
n = n % 4
x = n // 3
s = '#' * m + '\n' + '.' * (m - 1) + '#' + '\n' + '#' * m
n = n % 3
for i in range(x):
	print(s)
x = n // 2
s = '#' * m + '\n' + '.' * (m - 1) + '#'
n = n % 2
for i in range(x):
	print(s)
x = n // 1
s = '#' * m
for i in range(x):
	print(s)


(n, f) = input().split()
n = int(n)
f = int(f)
shetchik = 0
while shetchik < n:
	stroka = ''
	shetchik123 = 0
	while shetchik123 < f:
		if shetchik % 2 == 0:
			stroka = stroka + '#'
		elif shetchik % 4 == 1:
			if shetchik123 < f - 1:
				stroka = stroka + '.'
			else:
				stroka = stroka + '#'
		elif shetchik123 != 0:
			stroka = stroka + '.'
		else:
			stroka = stroka + '#'
		shetchik123 = shetchik123 + 1
	shetchik = shetchik + 1
	print(stroka)


(n, m) = map(int, input().split())
snake = '#' * m
nosnake = '.' * (m - 1) + '#'
even = snake + '\n' + nosnake
odd = snake + '\n' + nosnake[::-1]
for i in range(n // 2 + 1):
	if i + 1 > n // 2:
		print(snake)
	elif i % 2 == 0:
		print(even)
	else:
		print(odd)


def line(a):
	print('#' * a)

def right(a):
	print('.' * (a - 1) + '#')

def left(a):
	print('#' + '.' * (a - 1))
(n, m) = map(int, input().strip().split(' '))
k = 0
for i in range(n):
	k += 1
	if k == 1 or k == 3:
		line(m)
	elif k == 2:
		right(m)
	elif k == 4:
		left(m)
	if k == 4:
		k = 0


(n, k) = map(int, input().split())
i = 1
while i <= n:
	if i % 2 == 1:
		print('#' * k)
		i += 1
	elif i % 4 == 2:
		print('.' * (k - 1) + '#')
		i += 1
	else:
		print('#' + '.' * (k - 1))
		i += 1


(row, col) = input().split()
row = int(row)
col = int(col)
flag = True
for x in range(0, row):
	if x % 2 == 0:
		print('#' * col)
	else:
		if flag:
			print('.' * (col - 1) + '#')
		else:
			print('#' + '.' * (col - 1))
		flag = not flag


home = list(map(int, input().split()))
for num in range(home[0]):
	if num % 2 == 0:
		print(home[1] * '#')
	elif num // 2 % 2 == 0:
		print((home[1] - 1) * '.' + '#')
	else:
		print('#' + (home[1] - 1) * '.')


(y, x) = map(int, input().split())
for i in range(y // 2):
	print('#' * x)
	if i % 2 == 0:
		print('.' * (x - 1) + '#')
	else:
		print('#' + '.' * (x - 1))
print(x * '#')


s = input().split()
n = int(s[0])
m = int(s[1])
for i in range(1, n + 1):
	if i % 2 != 0:
		for j in range(m):
			print('#', end='')
	elif i % 4 == 0:
		print('#', end='')
		for k in range(m - 1):
			print('.', end='')
	else:
		for l in range(m - 1):
			print('.', end='')
		print('#', end='')
	print()


(n, m) = map(int, input().split())
flag = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print('#', end='')
	elif flag:
		print('#', end='')
		for j in range(m - 1):
			print('.', end='')
		flag = 1 - flag
	elif not flag:
		for j in range(m - 1):
			print('.', end='')
		print('#', end='')
		flag = 1 - flag
	print('')


a = input()
a = [int(i) for i in a.split(' ')]
ligne = a[0]
colonne = a[1]
odd_lines = '#' * colonne + '\n'
even_lines = (colonne - 1) * '.' + '#'
resultat = ''
for i in range(ligne):
	if i % 2 == 0:
		resultat += odd_lines
	else:
		resultat += even_lines + '\n'
		even_lines = even_lines[::-1]
print(resultat)


x = input().split()
n = int(x[0])
n1 = int(x[1])
c = 1
for i in range(n):
	s = str('')
	for y in range(n1):
		if i % 2 == 0:
			s += '#'
		else:
			s += '.'
	if i % 2 != 0:
		if c == 1:
			print(s[1:] + '#')
			c = 0
		else:
			print('#' + s[1:])
			c = 1
	else:
		print(s)


import sys
answer = 'NO'
parametrs = list(map(int, input().split()))
n = parametrs[0]
m = parametrs[1]
right = True
line = True
while n > 0:
	if line:
		print('#' * m)
		line = False
	else:
		if right:
			print('.' * (m - 1) + '#')
			right = False
		else:
			print('#' + '.' * (m - 1))
			right = True
		line = True
	n = n - 1


(rows, columns) = map(int, input().split())
padding = '.' * (columns - 1)
for i in range(rows):
	if i % 2 == 0:
		print('#' * columns)
	elif i % 4 == 1:
		print(padding + '#')
	else:
		print('#' + padding)


(row, column) = map(int, input().split())
test = False
str1 = '.' * (column - 1) + '#'
str2 = '#' + '.' * (column - 1)
for r in range(0, row):
	if r % 2 == 0:
		print('#' * column)
	elif test == False:
		print(str1)
		test = True
	else:
		print(str2)
		test = False


(a, b) = map(int, input().split())
c = '.' * (b - 1) + '#'
d = '#' + '.' * (b - 1)
e = '#' * b
for i in range(1, a + 1):
	if i % 2 != 0:
		print(e)
	elif i % 4 == 0:
		print(d)
	else:
		print(c)


(n, m) = map(int, input().split())
h = ''
dt = ''
for _ in range(m):
	h = h + '#'
	dt = dt + '.'
lst = dt[1:m] + '#'
fst = '#' + dt[1:m]
for i in range(1, n + 1):
	if i % 2 == 0:
		if i % 4 == 0:
			print(fst)
		else:
			print(lst)
	else:
		print(h)


(n, m) = [int(x) for x in input().split()]
print('#' * m)
swch = 1
for _ in range(0, n - 1, 2):
	if swch:
		print('.' * (m - 1) + '#')
	else:
		print('#' + '.' * (m - 1))
	swch = not swch
	print('#' * m)


(row, column) = input().split()
row = int(row)
column = int(column)
for i in range(row + 1):
	if i == 0:
		continue
	if i % 2 != 0:
		print('#' * column)
	if i % 4 == 0:
		print('#' + '.' * (column - 1))
		continue
	if i % 2 == 0:
		print('.' * (column - 1) + '#')


(n, m) = map(int, input().split())
str = ''
lr = False
for i in range(1, n + 1):
	if i % 2 == 0:
		l = '.' * (m - 1)
		if lr:
			l = '#' + l
		else:
			l += '#'
		lr = not lr
		str += l
	else:
		str += '#' * m
	str += '\n'
print(str)


s = input().split()
n = int(s[0])
m = int(s[1])
mass = []
for i in range(n):
	tmp = []
	for j in range(m):
		tmp.append('.')
	mass.append(tmp)
for i in range(n):
	for j in range(m):
		if (i + 1) % 2 == 1:
			mass[i][j] = '#'
		elif (i + 1) % 4 == 2:
			mass[i][m - 1] = '#'
		elif (i + 1) % 4 == 0:
			mass[i][0] = '#'
for i in range(n):
	print(*mass[i], sep='')


s = input().split()
n = int(s[0])
m = int(s[1])
a = []
k = 0
for i in range(n):
	a.append([])
	r = 0
	for j in range(m):
		if i % 2 == 0:
			a[i].append('#')
		elif k == 0 and j == m - 1 and (r == 0):
			a[i].append('#')
			k = 1
		elif j == 0 and k == 1:
			k = 0
			r = 1
			a[i].append('#')
		else:
			a[i].append('.')
for i in range(n):
	for j in range(m):
		print(a[i][j], end='')
	print()


(n, m) = map(int, input().split())
body = '#' * m + '\n'
body2 = '.' * (m - 1) + '#'
res = ''
for i in range(n):
	if i % 4 == 0 or i % 4 == 2:
		res += body
	elif i % 4 == 1:
		res += body2 + '\n'
	elif i % 4 == 3:
		res += body2[::-1] + '\n'
print(res)


(n, m) = map(int, input().split())
res = []
f = 0
for i in range(1, n + 1):
	if i & 1 == 1:
		res.append('#' * m)
	elif not f:
		res.append('.' * (m - 1) + '#')
		f = 1
	else:
		res.append('#' + '.' * (m - 1))
		f = 0
for i in res:
	print(i)


l = list(map(int, input().strip().split()))
n = l[0]
m = l[1]
arr = []
for i in range(n):
	a = []
	for j in range(m):
		a.append('#')
	arr.append(a)
for i in range(1, n, 2):
	a = i // 2
	if a % 2 == 0:
		for j in range(m - 1):
			arr[i][j] = '.'
	else:
		for j in range(1, m):
			arr[i][j] = '.'
for i in range(n):
	for j in range(m):
		print(arr[i][j], end='')
	print()


(n, m) = map(int, input().split(' '))
line = ['' for i in range(n)]
cnt = int(n / 2) + 1
for i in range(cnt):
	line[i * 2] = '#' * m
	if i * 2 + 1 <= n - 1:
		if i % 2 == 0:
			for j in range(m):
				if j < m - 1:
					line[i * 2 + 1] += '.'
				else:
					line[i * 2 + 1] += '#'
		else:
			for j in range(m):
				if j == 0:
					line[i * 2 + 1] += '#'
				else:
					line[i * 2 + 1] += '.'
for i in range(n):
	print(line[i])


(n, m) = map(int, input().split())
ck1 = ck2 = True
while 0 < n:
	if ck1:
		print('#' * m)
		ck1 = False
	else:
		if ck2:
			print('.' * (m - 1) + '#')
			ck2 = False
		else:
			print('#' + '.' * (m - 1))
			ck2 = True
		ck1 = True
	n -= 1


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(N, M) = map(int, input().split())
left = False
for i in range(1, N + 1):
	if i % 2 == 1:
		print('#' * M)
	elif left:
		print('#' + '.' * (M - 1))
		left = False
	else:
		left = True
		print('.' * (M - 1) + '#')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, m) = LI()
	r = []
	for i in range(n):
		if i % 2 == 0:
			r.append('#' * m)
		elif i % 4 == 1:
			r.append('.' * (m - 1) + '#')
		else:
			r.append('#' + '.' * (m - 1))
	return '\n'.join(r)
print(main())


def snakes(n, m):
	print('#' * m)
	temp = 2
	for i in range(1, n, 2):
		if temp % 2 != 0:
			print('#' + '.' * (m - 1))
			print('#' * m)
			temp += 1
		else:
			print('.' * (m - 1) + '#' * 1)
			print('#' * m)
			temp += 1
(n, m) = input().split()
snakes(int(n), int(m))


def f(a, b, c):
	if a == 1:
		return '#' * b
	if c:
		return '#' * b + '\n' + '.' * (b - 1) + '#\n' + f(a - 2, b, 1 - c)
	return '#' * b + '\n#' + '.' * (b - 1) + '\n' + f(a - 2, b, 1 - c)
a = list(map(int, input().split()))
print(f(a[0], a[1], 1))


(r, c) = [int(i) for i in input().split()]
a = 1
for i in range(1, r + 1):
	if i % 2 == 1:
		print('#' * c)
	else:
		if a % 2 == 1:
			print('.' * (c - 1) + '#')
		else:
			print('#' + '.' * (c - 1))
		a += 1


(n, m) = list(map(int, input().split()))
c = '#'
for i in range(1, n + 1):
	s = ''
	p = ''
	if i % 2 != 0:
		for j in range(m):
			s = s + '#'
		print(s)
	else:
		if c == '#':
			for j in range(m - 1):
				p = p + '.'
			p = p + '#'
			c = p[0]
		else:
			p = p + '#'
			for j in range(1, m):
				p = p + '.'
			c = p[0]
		print(p)


(n, m) = tuple((int(x) for x in input().split()))
right = True
while n:
	if n % 2 == 1:
		print('#' * m)
	elif right:
		print('.' * (m - 1), '#', sep='')
		right = False
	else:
		print('#', '.' * (m - 1), sep='')
		right = True
	n -= 1


(m, n) = list(map(int, input().split()))
for x in range(1, m + 1):
	if x % 2 != 0:
		print('#' * n)
	elif x % 4 == 0:
		print('#', end='')
		print('.' * (n - 1))
	else:
		print('.' * (n - 1), end='')
		print('#')


x = list(map(int, input().split()))
a = b = c = '#'
q = 1
for i in range(x[0]):
	print(a, end='')
	for j in range(x[1] - 2):
		print(b, end='')
	print(c)
	if i % 2:
		a = b = c = '#'
	else:
		if q:
			a = '.'
			b = '.'
			c = '#'
		else:
			a = '#'
			b = '.'
			c = '.'
		q = not q


(n, m) = tuple(map(int, input().split()))
body = '#' * m
r = '.' * (m - 1) + '#'
l = '#' + '.' * (m - 1)
print(body)
row = 1
while row < n:
	if row < n:
		print(r)
		print(body)
		row += 2
	if row < n:
		print(l)
		print(body)
		row += 2


(n, m) = list((int(x) for x in input().split()))
snake = '#'
body = snake * m
empty = '.' * (m - 1)
flag = True
for row in range(0, n):
	if row % 2 == 0:
		print(body)
	else:
		if flag:
			print(empty + snake)
		else:
			print(snake + empty)
		flag = not flag


(row, col) = map(int, input().split())
s1 = '#' * col
s2 = ''
for i in range(col - 1):
	s2 = s2 + '.'
s2 = s2 + '#'
s3 = s2[::-1]
c = 0
for i in range(1, row + 1):
	if i % 2 != 0:
		print(s1)
	elif i % 2 == 0 and c == 0:
		print(s2)
		c = 1
	else:
		print(s3)
		c = 0


n = input()
for i in range(len(n)):
	if n[i] == ' ':
		a = int(n[:i])
		b = int(n[i + 1:])
		break
c = [0 for l in range(a)]
for j in range(0, a, 2):
	c[j] = '#' * b
for k in range(1, a, 4):
	c[k] = '.' * (b - 1) + '#'
for k in range(3, a, 4):
	c[k] = '#' + '.' * (b - 1)
for m in range(len(c)):
	print(c[m])


(r, c) = map(int, input().split())
s1 = '#' * c
s2 = '.' * (c - 1) + '#'
for i in range(1, r + 1):
	if i % 2 == 0:
		print(s2)
		s2 = s2[::-1]
	else:
		print(s1)


data = input().split()
BodyHt = int(data[0])
BodyLen = int(data[1])
Body = list()
RightBody = list()
LeftBody = list()
for x in range(BodyLen):
	Body.append('#')
separator = ''
BODY = separator.join(Body)
for x in range(BodyLen):
	RightBody.append('.')
RightBody[BodyLen - 1] = '#'
separator = ''
RIGHTBODY = separator.join(RightBody)
for x in range(BodyLen):
	LeftBody.append('.')
LeftBody[0] = '#'
separator = ''
LEFTBODY = separator.join(LeftBody)
Left = 0
Right = 0
row = 0
while row < BodyHt:
	print(BODY)
	row += 1
	if row == BodyHt:
		break
	if Right == 0 or Right <= Left:
		print(RIGHTBODY)
		Right += 1
		row += 1
		continue
	if Left < Right:
		print(LEFTBODY)
		Left += 1
		row += 1
		continue


def pnt(n, m):
	i = 0
	while i < n:
		j = 0
		while j < m:
			if i % 2 == 0 or (i % 2 == 1 and (i % 4 == 1 and j == m - 1 or (i % 4 == 3 and j == 0))):
				print('#', end='')
			else:
				print('.', end='')
			j += 1
		print('')
		i += 1
(a, b) = input().split()
a = int(a)
b = int(b)
pnt(a, b)


a = [int(s) for s in input().split()]
(n, m, c, z) = (a[0], a[1], 0, 1)
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			print('#', end='')
		print()
	elif z == 1:
		for j in range(m - 1):
			print('.', end='')
		print('#', end='')
		print()
		z = 0
		c = 1
	elif c == 1:
		print('#', end='')
		for j in range(m - 1):
			print('.', end='')
		print()
		z = 1
		c = 0


(n, m) = map(int, input().split())
i = check = 1
for j in range(0, m):
	print('#', end='')
print(end='\n')
while i < n:
	if check:
		for j in range(0, m - 1):
			print('.', end='')
		print('#', end='\n')
		check = 0
	else:
		print('#', end='')
		for j in range(0, m - 1):
			print('.', end='')
		print(end='\n')
		check = 1
	for j in range(0, m):
		print('#', end='')
	print(end='\n')
	i += 2


(x, y) = [int(a) for a in input().split()]
hashtag = '#'
dot = '.'
position = 0
for i in range(x):
	if i % 2 == 0:
		print(hashtag * y)
	elif position % 2 == 0:
		print(dot * (y - 1) + hashtag)
		position += 1
	else:
		print(hashtag + dot * (y - 1))
		position += 1


(lines, width) = [int(x) for x in input().split()]
for i in range(lines):
	res = i % 4
	if res in [0, 2]:
		print('#' * width)
	if res == 1:
		print('.' * (width - 1) + '#')
	if res == 3:
		print('#' + '.' * (width - 1))


def main():
	entry = input()
	entry = entry.split()
	flag = True
	(y, x) = (int(entry[0]), int(entry[1]))
	for i in range(y):
		if i % 2 == 0:
			print(x * '#', end='')
		else:
			if flag:
				print((x - 1) * '.', end='')
				print('#', end='')
			else:
				print('#', end='')
				print((x - 1) * '.', end='')
			flag = not flag
		print()
main()


n = list(map(int, input().split()))
res = []
pos = 0
for i in range(1, n[0] + 1):
	if i % 2 != 0:
		res.append('#' * n[1])
	elif pos == 0:
		res.append('.' * (n[1] - 1) + '#')
		pos += 1
	else:
		res.append('#' + '.' * (n[1] - 1))
		pos -= 1
for i in res:
	print(i)


import sys
import os.path
import math
import heapq
from sys import stdin, stdout
from collections import *
from math import gcd, ceil, floor
mod = int(1000000000.0 + 7)
if os.path.exists('Updated prg/Input3d.txt'):
	sys.stdout = open('Updated prg/Output3d.txt', 'w')
	sys.stdin = open('Updated prg/Input3d.txt', 'r')

def sinp():
	return input()

def ninp():
	return int(sinp())

def mapinp():
	return map(int, sinp().split())

def linp():
	return list(mapinp())

def sl():
	return list(sinp())

def prnt(a):
	print(a)

def prntl(a):
	print(a, end=' ')

def prntlist(l1):
	print(*l1)

def power(n):
	return 1 << n
(n, m) = mapinp()
s1 = ''
for i in range(n):
	if i % 2 == 0:
		s1 = '#' * m
		prnt(s1)
	elif i % 4 == 1:
		s1 = '.' * (m - 1)
		s1 = s1 + '#'
		prnt(s1)
	else:
		s1 = '#'
		s1 = s1 + '.' * (m - 1)
		prnt(s1)


(n, m) = [int(i) for i in input().split()]
a0 = m * '#'
a1 = (m - 1) * '.' + '#'
a2 = '#' + (m - 1) * '.'
i = 1
while i <= n:
	if i % 2 == 1:
		print(a0)
	if i % 4 == 0:
		print(a2)
	if i % 4 == 2:
		print(a1)
	i += 1


l = [int(s) for s in input().split()]
z = 1
for i in range(l[0]):
	c = ''
	a = '#'
	if i % 2 != 0:
		z *= -1
	for j in range(l[1]):
		c += a
		if i % 2 != 0:
			a = '.'
	c = c[::z]
	print(c)


n = list(map(int, input().split()))
e = '#'
o1 = ''
o2 = '#'
for f in range(n[1] - 1):
	e += '#'
	o1 += '.'
	o2 += '.'
o1 += '#'
for f in range(n[0]):
	if (f + 1) % 2 != 0:
		print(e)
	elif (f + 1) % 4:
		print(o1)
	else:
		print(o2)


(n, m) = map(int, input().split(' '))
s = (['#' * m] + ['.' * (m - 1) + '#'] + ['#' * m] + ['#' + '.' * (m - 1)]) * 100
for i in range(n):
	print(s[i])


import sys
import math
import bisect

def main():
	(n, m) = map(int, input().split())
	for i in range(n):
		if i % 2 == 0:
			A = ['#'] * m
			print(''.join(A))
		else:
			A = ['.'] * m
			if i % 4 == 1:
				A[m - 1] = '#'
			else:
				A[0] = '#'
			print(''.join(A))
main()


(y, x) = map(int, input().split())
i = t = 1
while i <= y:
	if i % 2 != 0:
		print('#' * x)
	elif i % 2 == 0 and t == 1:
		print('.' * (x - 1) + '#')
		t = 2
	elif i % 2 == 0 and t == 2:
		print('#' + '.' * (x - 1))
		t = 1
	i += 1


(n, m) = input().strip().split()
for i in range(int(n)):
	if (i + 1) % 2 == 1:
		a = ''
		for j in range(int(m)):
			a = a + '#'
		print(a)
		continue
	if (i + 1) % 4 == 0:
		a = ''
		a = a + '#'
		for j in range(int(m) - 1):
			a = a + '.'
		print(a)
		continue
	if (i + 1) % 2 == 0:
		a = ''
		for j in range(int(m) - 1):
			a = a + '.'
		a = a + '#'
		print(a)
		continue


(a, b) = map(int, input().split())
arr = []
snake = '#' * b
dot = '.' * (b - 1) + '#'
for i in range(0, a):
	if i % 2 == 0:
		arr.append(snake)
	else:
		arr.append(dot)
		dot = dot[::-1]
print(*arr, sep='\n')


(n, m) = map(int, input().split())
mas = []
mas_ne = [x for x in range(50) if x % 2 == 1]
p = 1
for i in range(n):
	if i % 2 == 0:
		mas.append(m * '#')
	else:
		if mas_ne.index(p) % 2 == 0:
			mas.append((m - 1) * '.' + '#')
		else:
			mas.append('#' + (m - 1) * '.')
		p += 2
for i in mas:
	print(i)


import math

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
(n, m) = mi()
f = 1
a = [['.' for i in range(m)] for j in range(n)]
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			a[i][j] = '#'
	elif f:
		a[i][m - 1] = '#'
		f = 0
	else:
		a[i][0] = '#'
		f = 1
for i in range(n):
	for j in range(m):
		print(a[i][j], end='')
	print()


s = input().split(' ')
nrows = int(s[0])
ncols = int(s[1])
turn = False
for i in range(nrows):
	if i % 2 == 0:
		print('#' * ncols)
	elif not turn:
		print('.' * (ncols - 1) + '#')
		turn = True
	else:
		print('#' + '.' * (ncols - 1))
		turn = False


a = list(map(int, input().split()))
for x in range(a[0]):
	if x % 2 == 0:
		for y in range(a[1]):
			print('#', end='')
	else:
		if x % 4 == 1:
			for y in range(a[1] - 1):
				print('.', end='')
			print('#', end='')
		if x % 4 == 3:
			print('#', end='')
			for y in range(a[1] - 1):
				print('.', end='')
	print()


import sys
from math import *
(n, m) = map(int, input().split())
for i in range(n):
	for j in range(m):
		print('#' if i % 2 == 0 or (i % 4 == 1 and j == m - 1) or (i % 4 == 3 and j == 0) else '.', end='')
	print()


(n, m) = map(int, input().split())
for x in range(n):
	if x % 2 == 0:
		print('#' * m)
	elif x % 4 == 1:
		print('.' * (m - 1) + '#')
	elif x % 4 == 3:
		print('#' + '.' * (m - 1))


def func(n):
	height = n[0]
	length = n[1]
	counter = 0
	for i in range(height):
		if i % 2 == 0:
			print('#' * length)
		elif i % 2 != 0 and counter % 2 == 0:
			print('.' * (length - 1) + '#')
			counter += 1
		elif i % 2 != 0 and counter % 2 != 0:
			print('#' + '.' * (length - 1))
			counter += 1
n = list(map(int, input().split()))
func(n)


import math
import itertools
gh = lambda : map(int, input().split())

def main():
	(n, m) = gh()
	(x, y) = (1, 1)
	arr = [['.' for i in range(m + 1)] for j in range(n + 1)]
	while x <= n:
		if x % 4 == 1:
			while y <= m:
				arr[x][y] = '#'
				y += 1
			y = m
		else:
			while y > 0:
				arr[x][y] = '#'
				y -= 1
			y = 1
		if x != n:
			arr[x + 1][y] = '#'
		x += 2
	for i in range(1, n + 1):
		for j in range(1, m + 1):
			print(arr[i][j], end='')
		print()
main()


(n, m) = map(int, input().split(' '))
i = 0
j = 0
while i < n:
	j = 0
	while j < m:
		print('#', end='')
		j += 1
	print('')
	i += 1
	if i >= n:
		continue
	j = 0
	while j < m - 1:
		print('.', end='')
		j += 1
	print('#')
	i += 1
	if i >= n:
		continue
	j = 0
	while j < m:
		print('#', end='')
		j += 1
	print('')
	i += 1
	if i >= n:
		continue
	j = 0
	print('#', end='')
	while j < m - 1:
		print('.', end='')
		j += 1
	print('')
	i += 1


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
(n, m) = q()
for i in range(1, n + 1):
	if i % 4 == 0:
		print('#' + '.' * (m - 1))
	elif i % 2 == 0:
		print('.' * (m - 1) + '#')
	else:
		print('#' * m)


def snakeBod(h):
	snek = ''
	for number in range(0, h):
		snek += '#'
	print(snek)

def snakeGroundRight(h):
	snek = ''
	for number in range(0, h - 1):
		snek += '.'
	snek += '#'
	print(snek)

def snakeGroundLeft(h):
	snek = ''
	snek += '#'
	for number in range(0, h - 1):
		snek += '.'
	print(snek)
(v, h) = input().split()
h = int(h)
v = int(v)
switch = 0
for i in range(0, v):
	if i % 2 == 0:
		snakeBod(h)
	elif switch == 0:
		snakeGroundRight(h)
		switch = 1
	elif switch == 1:
		snakeGroundLeft(h)
		switch = 0


(n, m) = input().split()
n = int(n)
m = int(m)
s1 = '#'
s2 = '.'
s = ''
c = 0
for i in range(n):
	if i % 2 == 0:
		for j in range(m):
			s = s + s1
		c = c + 1
	elif c % 2 == 1:
		for i in range(m):
			if i == m - 1:
				s = s + s1
			else:
				s = s + s2
	elif c % 2 == 0:
		for i in range(m):
			if i == 0:
				s = s + s1
			else:
				s = s + s2
	print(s)
	s = ''


def ans():
	(n, m) = [int(i) for i in input().split()]
	a = '#' * m
	b = '.' * (m - 1)
	for i in range(n):
		if (i + 1) % 2 == 1:
			print(a)
		elif (i + 1) % 4 == 0:
			print('#' + b)
		else:
			print(b + '#')
	return
ans()


(n, m) = map(int, input().split())
ok = 1
for i in range(1, n + 1):
	for j in range(1, m + 1):
		if i % 2 == 1:
			print('#', sep='', end='')
		elif j == m and ok == -1:
			print('#', sep='', end='')
		elif j == 1 and ok == 1:
			print('#', sep='', end='')
		else:
			print('.', sep='', end='')
	print()
	if i % 2 == 1:
		ok = -ok


(n, m) = map(int, input().split())
l = [['#' for i in range(m)] for j in range(n // 2 + 1)]
p = [['.' for i in range(m)] for j in range(n // 2)]
for k in range(n):
	if k % 2 == 0:
		g = int(k / 2)
		print(''.join(l[g]))
	else:
		g = int(k / 2)
		if (k + 1) % 4 == 0:
			p[g].pop(1)
			p[g].insert(0, '#')
			print(''.join(p[g]))
		else:
			p[g].pop()
			p[g].append('#')
			print(''.join(p[g]))


def main():
	(n, m) = input().split()
	(n, m) = (int(n), int(m))
	(s, s2, s3) = (''.join(['#' for i in range(m)]), ''.join(['.' for i in range(m - 1)]) + '#', '#' + ''.join(['.' for i in range(m - 1)]))
	for i in range(n):
		if i % 2 == 0:
			print(s)
		elif i == 3 or (i - 3) % 4 == 0:
			print(s3)
		else:
			print(s2)
main()


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)
from math import ceil, floor, log, sqrt, factorial

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, m) = get_ints()
mat = [['.' for i in range(m)] for j in range(n)]
flag = 0
for i in range(n):
	if i % 2 == 0:
		mat[i] = ['#'] * m
	elif i & 1 and flag == 0:
		mat[i] = ['.'] * (m - 1) + ['#']
		flag = 1
	elif i & 1 and flag == 1:
		mat[i] = ['#'] + ['.'] * (m - 1)
		flag = 0
for i in mat:
	print(''.join(i))


(width, length) = list(map(int, input().split()))
uzor = ['.' * length for j in range(width)]
for i in range(width):
	if i % 2 == 0:
		uzor[i] = '#' * length
	if i % 4 == 1:
		uzor[i] = '.' * (length - 1) + '#'
	if i % 4 == 3:
		uzor[i] = '#' + '.' * (length - 1)
print('\n'.join(uzor))


(a, b) = map(int, input().split())
i = 0
while i < a:
	j = 0
	c = []
	if i % 2 == 0:
		while j < b:
			c.append('#')
			j = j + 1
		print(''.join(c))
	else:
		k = int(i / 2)
		if k % 2 == 0:
			while j < b - 1:
				c.append('.')
				j = j + 1
			c.append('#')
			print(''.join(c))
		else:
			c.append('#')
			while j < b - 1:
				c.append('.')
				j = j + 1
			print(''.join(c))
	i = i + 1


a = input().split()
for i in range(2):
	a[i] = int(a[i])
str1 = '#' * a[1]
str2 = '.' * (a[1] - 1) + '#'
str3 = '#' + '.' * (a[1] - 1)
b = 0
for i in range(0, a[0] - 1, 2):
	if b == 0 or b % 2 == 0:
		print(str1)
		print(str2)
	else:
		print(str1)
		print(str3)
	b = b + 1
print(str1)


(n, m) = input().split(' ')
n = int(n)
m = int(m)
front = True
string = '#' * m
string1 = '.' * (m - 1) + '#'
string2 = '#' + '.' * (m - 1)
for i in range(1, n + 1):
	if i % 2 != 0:
		print(string)
	elif front:
		print(string1)
		front = False
	else:
		print(string2)
		front = True


multin = lambda : map(int, input().split())
(n, m) = multin()
l1 = [x for x in range(1, n, 4)]
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif i in l1:
		print('.' * (m - 1) + str('#'))
	else:
		print('#' + str('.' * (m - 1)))


(r, c) = map(int, input().split())
grid = [['.' for _ in range(c)] for _ in range(r)]
for i in range(0, r, 2):
	for j in range(c):
		grid[i][j] = '#'
f = 0
for i in range(1, r, 2):
	if f == 0:
		grid[i][-1] = '#'
		f = 1
	else:
		grid[i][0] = '#'
		f = 0
for i in grid:
	for j in i:
		print(j, end='')
	print()


(n, m) = map(int, input().split())
rl = True
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	elif rl:
		print('{}{}'.format('.' * (m - 1), '#'))
		rl = False
	else:
		print('{}{}'.format('#', '.' * (m - 1)))
		rl = True


(x, y) = map(int, input().split(' '))
i = 1
while i <= x:
	if i % 2 != 0:
		print(y * '#')
	elif i % 2 == 0 and i % 4 != 0:
		print('.' * (y - 1) + '#')
	else:
		print('#' + '.' * (y - 1))
	i = i + 1


(n1, n2) = map(int, input().split())
for i in range(1, n1 + 1):
	if i % 2 == 1:
		print('#' * n2)
	elif i % 4 == 2:
		print('.' * (n2 - 1), end='')
		print('#')
	elif i % 4 == 0:
		print('#', end='')
		print('.' * (n2 - 1))


(n, m) = map(int, input().split())
body_row = '#' * m
empty_row = '.' * (m - 1)
toggle = True
for i in range(n):
	if not i & 1:
		print(body_row)
	elif toggle:
		print(empty_row + '#')
		toggle = not toggle
	else:
		print('#' + empty_row)
		toggle = not toggle


nm = list(map(int, input().strip().split(' ')))
n = nm[0]
m = nm[1]
for i in range(1, n + 1):
	if i % 2 != 0:
		print('#' * m)
	elif i % 2 == 0 and i % 4 != 0:
		print('.' * (m - 1) + '#')
	elif i % 2 == 0 and i % 4 == 0:
		print('#' + '.' * (m - 1))


(n, m) = map(int, input().split())
count = 0
L = []
while n > 0:
	p = m
	l = []
	if n % 2 != 0:
		while p > 0:
			l.append('#')
			p = p - 1
	elif n % 2 == 0:
		count = count + 1
		while p > 0:
			l.append('.')
			p = p - 1
	if count % 2 == 0:
		l[0] = '#'
	elif count % 2 != 0:
		l[-1] = '#'
	L.append(l)
	n = n - 1
for item in range(len(L)):
	print(*L[item], sep='')


(r1, c1) = input().split()
r = int(r1)
c = int(c1)
l1 = [1]
l2 = [3]
j = 4
for i in range(r - 3):
	if i % 2 != 0:
		l1.append(i + j)
		j += 2
j = 4
for i in range(3, r - 3):
	if i % 2 != 0:
		l2.append(i + j)
		j += 2
for i in range(r):
	if i % 2 == 0:
		print('#' * c)
	elif i in l1:
		print('.' * (c - 1), end='#\n')
	elif i in l2:
		print('#', end='')
		print('.' * (c - 1))


nm = input('')
nm = nm.split()
n = int(nm[0])
m = int(nm[1])
count = 0
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * m)
	else:
		count += 1
		if count % 2 == 1:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))


(n, m) = map(int, input().split())
arr = []
i = 0
r1 = 0
r2 = 3
while i < n:
	if i == r1:
		arr.append(['#'] * m)
		i += 1
		r1 += 2
	elif i == r2:
		arr.append(['#'] + ['.'] * (m - 1))
		i += 1
		r2 += 4
	else:
		arr.append(['.'] * (m - 1) + ['#'])
		i += 1
for i in arr:
	print(''.join(i))


num = list(map(int, input().strip().split()))
for i in range(1, num[0] + 1):
	if i % 2 == 0 and i % 4 != 0:
		print('.' * (num[1] - 1) + '#')
	elif i % 4 == 0:
		print('#' + '.' * (num[1] - 1))
	else:
		print('#' * num[1])


(n, m) = list(map(int, input().split()))
snake_cell = '#'
empty_cell = '.'
for i in range(1, n + 1):
	if i % 2 == 1:
		print(snake_cell * m)
	else:
		k = (i - 2) / 4 + 1
		if k.is_integer():
			print(empty_cell * (m - 1), snake_cell, sep='')
		else:
			print(snake_cell, empty_cell * (m - 1), sep='')


(r, l) = [int(x) for x in input().split()]
st = ''
st1 = ''
st2 = ''
n = l
while n != 0:
	st = st + '#'
	if n == l:
		st2 = st2 + '#'
	else:
		st2 = st2 + '.'
	if n == 1:
		st1 = st1 + '#'
	else:
		st1 = st1 + '.'
	n = n - 1
flag = 0
for i in range(1, r + 1):
	if i % 2 == 0:
		if flag == 0:
			print(st1)
			flag = 1
		else:
			print(st2)
			flag = 0
	else:
		print(st)
	r = r - 1


__author__ = 'artyom'
(n, m) = map(int, input().split())
(s, t) = (n - 1, m - 1)
picture = ''
for i in range(n):
	choice = i % 4
	if choice == 1:
		picture += '.' * t + '#'
	elif choice == 3:
		picture += '#' + '.' * t
	else:
		picture += '#' * m
	if i < s:
		picture += '\n'
print(picture)


(n, m) = map(int, input().split())
(s0, s1) = ('.' * (m - 1), '#' * m)
(s2, s3) = (s0 + '#', '#' + s0)
for i in range(n):
	mod = i % 4
	print({mod in {0, 2}: s1, mod == 1: s2, mod == 3: s3}[True])


(n, m) = map(int, input().split())
line = 1
(body, curve) = (1, 1)
while line <= n:
	if body & 1 and line <= n:
		print('#' * m)
		line += 1
	if curve & 1 and line <= n:
		print('.' * (m - 1), end='')
		print('#')
		line += 1
		curve += 1
	elif not curve & 1 and line <= n:
		print('#', end='')
		print('.' * (m - 1))
		line += 1
		curve += 1


(n, m) = map(int, input().split())
arr = [[0] * n] * m
for i in range(n):
	if i % 2 != 0:
		if int(i / 2) % 2 != 0:
			(print('#', end=''),)
			for k in range(m - 1):
				print('.', end='')
			print()
		else:
			for l in range(m - 1):
				print('.', end='')
			print('#')
	else:
		for j in range(m):
			print('#', end='')
		print()


l = input().split()
n = int(l[0])
m = int(l[1])
k = ['.' for i in range(m)]
a = [k[:] for i in range(n)]
for i in range(n):
	for x in range(m):
		if i % 2 == 0:
			a[i][x] = '#'
		if i % 4 == 1:
			a[i][-1] = '#'
		if i % 4 == 3:
			a[i][0] = '#'
for i in range(n):
	for v in range(m):
		print(a[i][v], end='')
	print()


(n, m) = [int(i) for i in input().split()]
a = []
for i in range(n):
	b = []
	for j in range(m):
		if i % 2 == 0:
			b.append('#')
		elif i % 4 == 1 and j == m - 1:
			b.append('#')
		elif i % 4 == 3 and j == 0:
			b.append('#')
		else:
			b.append('.')
	a.append(b)
for i in range(n):
	print(''.join(a[i]))


(Row, Col) = map(int, input().split())
patt = [['#'] * Col if i % 2 == 0 else ['.'] * Col for i in range(Row)]
x = 0
for i in range(1, Row, 2):
	x += 1
	patt[i][x % 2 * -1] = '#'
for lines in patt:
	print(''.join(lines))


(m, n) = map(int, input().split())
booli = True
first = '#' * n
second = '.' * (n - 1) + '#'
third = '#' + '.' * (n - 1)
for i in range(m):
	if i % 2 != 0:
		if booli:
			print(second)
			booli = False
		else:
			print(third)
			booli = True
	else:
		print(first)


def create_field():
	user = input().split()
	column = int(user[0])
	row = int(user[1])
	if row >= 3 and row <= 50:
		pass
	else:
		create_field()
	board = []
	snake_body = 0
	counter = 0
	if column > row:
		snake_body = column
	elif row > column:
		snake_body = row
	elif row == column:
		snake_body = row
	for i in range(1, snake_body):
		board.append(int(i))
	while column != 0:
		if column % 2 != 0:
			print('#' * row)
			column -= 1
		elif column % 2 == 0:
			if board[counter] % 2 != 0:
				print('.' * int(row - 1) + '#')
				column -= 1
				counter += 1
			elif board[counter] % 2 == 0:
				print('#', end='')
				print('.' * int(row - 1))
				column -= 1
				counter += 1
create_field()


def main():
	(n, m) = map(int, input().split(' '))
	snake = ''
	is_right = True
	for i in range(1, n + 1):
		if i % 2 == 1:
			snake += m * '#'
		else:
			if is_right:
				snake += (m - 1) * '.'
				snake += '#'
			else:
				snake += '#'
				snake += (m - 1) * '.'
			is_right = not is_right
		snake += '\n'
	print(snake)
main()


(n, m) = map(int, input().split())
a = True
b = True
for i in range(n):
	if a == True:
		print('#' * m)
		a = False
	else:
		if b == True:
			print('.' * (m - 1) + '#')
			b = False
		else:
			print('#' + '.' * (m - 1))
			b = True
		a = True


(n, m) = map(int, input().split())
output = []
a1 = '#' * m
a2 = '.' * (m - 1) + '#'
a3 = '#' * m
a4 = '#' + '.' * (m - 1)
for i in range(n):
	if i % 4 == 0:
		print(a1)
	elif i % 4 == 1:
		print(a2)
	elif i % 4 == 2:
		print(a3)
	else:
		print(a4)


N = list(map(int, input().split()))
ENABLE = True
OneLeft = True
for _ in range(N[0]):
	if ENABLE:
		ENABLE = False
		print('#' * N[1])
	else:
		ENABLE = True
		if OneLeft:
			OneLeft = False
			print('.' * (N[1] - 1) + '#')
		else:
			OneLeft = True
			print('#' + '.' * (N[1] - 1))


(n, m) = map(int, input().split())
table = ['#' * m for row in range(n)]
flag = True
for i in range(1, len(table) - 1, 2):
	if flag:
		table[i] = '.' * (m - 1) + '#'
		flag = False
	else:
		table[i] = '#' + '.' * (m - 1)
		flag = True
for i in range(len(table)):
	print(''.join([i for i in table[i]]))


def pattern(n, m):
	switch = True
	for i in range(n):
		if i % 2 == 0:
			print('#' * m)
		elif switch == True:
			print('.' * (m - 1) + '#')
			switch = False
		else:
			print('#' + '.' * (m - 1))
			switch = True
x = list(map(int, input().rstrip().split()))
n = x[0]
m = x[1]
pattern(n, m)


from sys import *
from math import *
from sys import stdin, stdout
from collections import *
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)

def ans(n, m):
	ct = 1
	for i in range(n):
		if i % 2 == 0:
			print('#' * m)
		elif ct % 2 != 0:
			print('.' * (m - 1) + '#')
			ct += 1
		else:
			print('#' + '.' * (m - 1))
			ct += 1
(n, m) = get_int()
ans(n, m)


(n, m) = map(int, input().split())
s2 = (m - 1) * '.' + '#'
for e in range(n):
	if e % 2 == 0:
		print(m * '#')
	else:
		print(s2)
		s2 = s2[::-1]


(n, m) = map(int, input().split())
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif i in range(1, 50, 4):
			if j == m - 1:
				print('#', end='')
				flag = 1
			else:
				print('.', end='')
		elif i in range(3, 50, 4):
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
	print('\n', end='')


words = input().split()
n = int(words[0])
m = int(words[1])
snake = ['#' * m for i in range(n)]
for i in range(3, n, 4):
	snake[i] = '#' + '.' * (m - 1)
for i in range(1, n, 4):
	snake[i] = '.' * (m - 1) + '#'
for s in snake:
	print(s)


inp = list(map(int, input().split()))
n = inp[0]
m = inp[1]
LR = 0
for a in range(1, n + 1):
	if a % 2 == 1:
		print('#' * m)
	elif LR % 2 == 0:
		print('.' * (m - 1) + '#')
		LR += 1
		continue
	elif LR % 2 == 1:
		print('#' + '.' * (m - 1))
		LR += 1
		continue


line = input()
line = line.split()
rows = int(line[0])
cols = int(line[1])
s1 = '#' * cols
s2 = '.' * (cols - 1) + '#'
s3 = '#' + '.' * (cols - 1)
for i in range(1, rows + 1):
	if i % 2 != 0:
		print(s1)
	elif i % 4 != 0:
		print(s2)
	else:
		print(s3)


(n, m) = [int(i) for i in input().split()]
(r, c) = ('.' * (m - 1), '#')
for i in range(n):
	print((r + '#' if i % 4 < 2 else '#' + r) if i % 2 else '#' * m)


a = list(map(int, input().split()))
(n, m) = (a[0], a[1])
j = 0
l1 = ['#' for i in range(0, m)]
l2 = ['.' for i in range(0, m - 1)] + ['#']
l3 = ['#'] + ['.' for i in range(0, m - 1)]
for i in range(0, n):
	if j == 0:
		print(''.join(l1))
		j += 1
	elif j == 1:
		print(''.join(l2))
		j += 1
	elif j == 2:
		print(''.join(l1))
		j += 1
	elif j == 3:
		print(''.join(l3))
		j = 0


(n, m) = list(map(int, input().split(' ')))
for i in range(1, n + 1):
	output = ''
	if i % 2 == 1:
		print('#' * m)
	elif i / 2 % 2 == 0:
		output = '#'
		for j in range(1, m):
			output += '.'
		print(output)
	elif i / 2 % 2 == 1:
		for k in range(1, m):
			output += '.'
		output += '#'
		print(output)


(y, x) = map(int, input().split())
result = []
h = True
for i in range(y):
	if not i % 2:
		result.append('#' * x)
		continue
	if h:
		result.append('#'.rjust(x, '.'))
	else:
		result.append('#'.ljust(x, '.'))
	h = not h
print('\n'.join(result))


(n, m) = map(int, input().split())
start = True
for y in range(1, n + 1):
	if y % 2 == 0:
		if start:
			print('.' * (m - 1), sep='', end='')
			print('#')
			start = False
		else:
			print('#', sep='', end='')
			print('.' * (m - 1), sep='')
			start = True
	else:
		print('#' * m, sep='')


(n, m) = map(int, input().split())
for a in range(1, n + 1):
	for b in range(1, m + 1):
		if a % 2 != 0 or (a % 2 == 0 and a % 4 != 0 and (b % m == 0)) or (a % 4 == 0 and b == 1):
			print('#', end='')
		else:
			print('.', end='')
	print()


p = input()
p = p.split()
n = int(p[0])
m = int(p[1])
i = 1
while i <= n:
	p = ''
	if i % 2 != 0:
		for j in range(m):
			p = p + '#'
		print(p)
	if i % 2 == 0:
		if i % 4 != 0:
			for j in range(m - 1):
				p = p + '.'
			print(p + '#')
		else:
			p = p + '#'
			for j in range(m - 1):
				p = p + '.'
			print(p)
	i = i + 1


(x, y) = map(int, input().split())
snake = []
row = '#' * y
snake = [row for i in range(x)]
for i in range(2, x + 1, 2):
	if i % 4 == 0:
		snake[i - 1] = '#' + '.' * (y - 1)
	elif i % 2 == 0:
		snake[i - 1] = '.' * (y - 1) + '#'
for i in range(x):
	print(snake[i])


(x, y) = [int(x) for x in input().strip().split()]
str_out = ['#' * y, '.' * (y - 1) + '#', '#' * y, '#' + '.' * (y - 1)]
for z in range(x):
	print(str_out[z % 4])


(a, b) = map(int, input().split())
x = '#' * b
y = '.' * (b - 1)
count = 0
for i in range(a):
	count += 1
	if count % 4 == 1 or count % 4 == 3:
		print(x)
	if count % 4 == 2:
		print(y.ljust(b, '#'))
	if count % 4 == 0:
		print(y.rjust(b, '#'))


(n, m) = map(int, input().split())
s = '#' * m
s1 = '.' * (m - 1)
s1 += '#'
s2 = '#'
s2 += '.' * (m - 1)
c = 0
i = 1
while i <= n:
	if i % 2 == 0:
		if c % 2 == 0:
			print(s1)
		else:
			print(s2)
		c += 1
	else:
		print(s)
	i += 1


(x, y) = [int(i) for i in input().split()]
p = []
for i in range(x):
	o = []
	if i % 2 == 0:
		for i in range(y):
			o.append('#')
		p.append(o)
	elif (i + 1) % 4 == 0:
		o.append('#')
		for i in range(y - 1):
			o.append('.')
		p.append(o)
	else:
		for i in range(y - 1):
			o.append('.')
		o.append('#')
		p.append(o)
for i in range(x):
	print(''.join(p[i]))


nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
line1 = '#' * m
line2 = '.' * (m - 1) + '#'
line3 = '#' + '.' * (m - 1)
lines = [line1, line2, line1, line3]
i = 0
for _ in range(n):
	if i == 4:
		i = 0
	print(lines[i])
	i += 1


(n, m) = [int(s) for s in input().split()]
e = 0
for x in range(1, n + 1):
	if x % 2 != 0:
		for _ in range(m):
			print('#', end='')
		print()
	elif e % 2 == 0:
		for _ in range(m - 1):
			print('.', end='')
		print('#')
		e += 1
	elif e % 2 != 0:
		print('#', end='')
		for _ in range(m - 1):
			print('.', end='')
		print()
		e += 1


(n, m) = list(map(int, input().split()))
c = 0
for i in range(0, n):
	lst = []
	for j in range(0, m):
		if i % 2 == 0:
			lst.append('#')
		else:
			c += 1
			if c % 2 != 0:
				for k in range(0, m - 1):
					lst.append('.')
				lst.append('#')
				break
			else:
				lst.append('#')
				for k in range(1, m):
					lst.append('.')
				break
	print(''.join(lst))


(n, m) = [int(i) for i in input().split()]
count = 0
s = m - 1
dot = ''
has = ''
for i in range(0, s):
	dot += '.'
	has += '#'
dot1 = '#' + dot
dot += '#'
has += '#'
for i in range(0, n):
	if i % 2 == 0:
		print(has)
	elif count == 0:
		print(dot)
		count = 1
	else:
		print(dot1)
		count = 0


def build_snake_matrix(n, m):
	matrix = [['.' for _ in range(m)] for _ in range(n)]
	i = 0
	j = 0
	while True:
		for jj in range(m):
			matrix[i][jj] = '#'
		j = m - 1 if j == 0 else 0
		if i < n - 2:
			for ii in range(i, i + 3):
				matrix[ii][j] = '#'
			i += 2
		else:
			break
	return matrix

def print_matrix(matrix):
	for row in matrix:
		for el in row:
			print(el, end='')
		print()

def draw_snake(n, m):
	snake = build_snake_matrix(n, m)
	print_matrix(snake)

def main():
	(n, m) = list(map(int, input().split()))
	draw_snake(n, m)
main()


(gorizontal, vertical) = list(map(int, input().split()))
k = 0
for i in range(1, gorizontal + 1):
	if i % 2 == 0 and k == 0:
		k = 1
		print('.' * (vertical - 1), '#', sep='')
	elif i % 2 == 0 and k == 1:
		k = 0
		print('#', '.' * (vertical - 1), sep='')
	else:
		print('#' * vertical)


(long, fat) = map(int, input().split())
left = 0
for i in range(1, long + 1):
	if i % 2 != 0:
		print('#' * fat)
	elif left == 0:
		print('.' * (fat - 1) + '#')
		left += 1
	else:
		print('#' + '.' * (fat - 1))
		left = 0


(n, m) = map(int, input().split())
left = '#' * m + '\n' + '#' + '.' * (m - 1)
right = '#' * m + '\n' + '.' * (m - 1) + '#'
ans = str()
c = (n - 1) // 2
while c > 0:
	ans += right + '\n'
	c -= 1
	if c > 0:
		ans += left + '\n'
		c -= 1
ans += '#' * m
print(ans)


(n, m) = map(int, input().split())
z = '#'
v = '.'
count = 0
for i in list(range(n)):
	if i % 2 == 0:
		print(z * m)
	else:
		if count % 2 != 0:
			print(z + v * (m - 1))
		else:
			print(v * (m - 1) + z)
		count += 1


(vyska, sirka) = map(int, input().split())
strana = -1
for i in range(vyska):
	if not i % 2:
		print('#' * sirka)
	else:
		if strana == 1:
			print('#' + '.' * (sirka - 1))
		elif strana == -1:
			print('.' * (sirka - 1) + '#')
		strana *= -1


(n, m) = map(int, input().split())
A = []
for r in range(n):
	if r % 2 != 0:
		a = ['.']
		a *= m
		A.append(a)
	else:
		a = ['#']
		a *= m
		A.append(a)
for R in range(1, n, 4):
	A[R][-1] = '#'
try:
	for L in range(3, n, 4):
		A[L][0] = '#'
except:
	pass
for lis in A:
	print(''.join(lis))


(n, m) = [int(x) for x in input().split()]
for y in range(n):
	to_print = ''
	if y % 2 == 0:
		to_print += '#' * m
	elif y % 4 == 1:
		to_print += '.' * (m - 1) + '#'
	elif y % 2 == 1:
		to_print += '#' + '.' * (m - 1)
	print(to_print)


(n, m) = map(int, input().split())
k = 0
for i in range(n):
	if i % 2 == 0:
		tab = ['#'] * m
		print(''.join(tab))
	elif k == 0:
		tab = ['.'] * (m - 1)
		tab.append('#')
		print(''.join(tab))
		k = 1
	else:
		tab = ['.'] * (m - 1)
		tab.insert(0, '#')
		print(''.join(tab))
		k = 0


def main():
	(n, m) = map(int, input().split())
	res = [['.'] * m for _ in range(n + 3)]
	res[::2] = [['#'] * m for _ in range(0, n + 3, 2)]
	for l in res[1::4]:
		l[-1] = '#'
	for l in res[3::4]:
		l[0] = '#'
	for l in res[:n]:
		print(''.join(l))

def __starting_point():
	main()
__starting_point()


(n, m) = map(int, input().split())
x = 1
for i in range(n):
	if not i & 1:
		print('#' * m)
	elif x == 1:
		print('.' * (m - 1) + '#')
		x = 0
	else:
		print('#' + '.' * (m - 1))
		x = 1


(n, m) = map(int, input().split())
x = [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47]
for i in range(n):
	if i % 2 != 0 and i not in x:
		for j in range(m):
			if j == m - 1:
				print('#', end='')
			else:
				print('.', end='')
	elif i % 2 != 0 and i in x:
		for j in range(m):
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
	else:
		for j in range(m):
			print('#', end='')
	print()


from sys import stdout
grid = input().split()
rows = int(grid[0])
columns = int(grid[1])
a = '%s\n' % ('#' * columns)
b = '#%s\n' % ('.' * (columns - 1))
c = '%s#\n' % ('.' * (columns - 1))
out = ''
for i in range(0, rows):
	out += a if i % 2 == 0 else b if int(i / 2) % 2 == 1 else c
stdout.write(out)


a = str(input(''))
b = a.split(' ')
n = int(b[0])
m = int(b[1])
count = 0
once = 0
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			if j == m - 1:
				print('#')
			else:
				print('#', end='')
		elif j == m - 1 and count == 0 and (once == 0):
			print('#')
			count = 1
			once = 1
		elif j == 0 and count == 1:
			print('#', end='')
			count = 0
		elif j == m - 1:
			print('.')
			once = 0
		else:
			print('.', end='')


arr = input().split(' ')
s_odd = '#' * int(arr[1])
s_even1 = '.' * (int(arr[1]) - 1) + '#'
s_even2 = '#' + '.' * (int(arr[1]) - 1)
s = s_even2
for i in range(1, int(arr[0]) + 1):
	if i % 2 != 0:
		print(s_odd)
	elif s == s_even1:
		s = s_even2
		print(s_even2)
	else:
		s = s_even1
		print(s_even1)


(rows, chars) = [int(i) for i in input().split()]
j = 0
for i in range(rows):
	if i % 2 == 0:
		print(chars * '#')
	elif j % 2 == 0:
		print((chars - 1) * '.' + '#')
		j += 1
	else:
		print('#' + (chars - 1) * '.')
		j += 1


string = input()
numbers = string.split(' ')
m = int(numbers[0])
n = int(numbers[1])

def line(input1):
	if input1 % 2 == 1:
		print('#' * n)
	elif input1 == 0:
		print('#' + '.' * (n - 1))
	elif input1 == 2:
		print('.' * (n - 1) + '#')
for x in range(1, m + 1):
	line(x % 4)


x = input()
(n, m) = (int(x.split()[0]), int(x.split()[1]))
full = '#' * m
half = '.' * (m - 1) + '#'
for i in range(n):
	if i % 2 == 0:
		print(full)
	elif i % 4 == 3:
		print(half[::-1])
	else:
		print(half)


(x, y) = map(int, input().split())
a = '#'
d = ''
for _ in range(y - 1):
	a += '#'
	d += '.'
b = '#' + d
c = d + '#'
for i in range(1, x + 1):
	if i % 2 == 1:
		print(a)
	elif i // 2 % 2 == 1:
		print(c)
	else:
		print(b)


from typing import List

def solve(n: int, m: int) -> List[str]:
	table = []
	for i in range(n):
		if i % 2 == 0:
			table.append('#' * m)
		elif (i + 1) % 4 == 0:
			table.append('#' + '.' * (m - 1))
		else:
			table.append('.' * (m - 1) + '#')
	return table
(n, m) = [int(x) for x in input().split()]
for row in solve(n, m):
	print(row)


(n, m) = map(int, input().split())
for q in range(1, n + 1, 2):
	print('#' * m)
	for i in range(1):
		if q == n:
			continue
		elif q in range(1, 51, 4):
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))


(n, m) = map(int, input().split())
l1 = [x for x in range(1, 51, 4)]
l2 = [x for x in range(3, 51, 4)]
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		elif i % 2 != 0 and i in l1 and (j == m - 1):
			print('#', end='')
		elif i % 2 != 0 and i in l2 and (j == 0):
			print('#', end='')
		else:
			print('.', end='')
	print()


def snake(row, column):
	for i in range(1, n + 1):
		if i % 2 != 0:
			print('#' * m)
		elif i % 4 != 0:
			print('.' * (m - 1) + '#')
		elif i % 4 == 0:
			print('#' + '.' * (m - 1))
(n, m) = map(int, input().split())
snake(n, m)


R = lambda : map(int, input().split())
(n, m) = R()
(a, b) = ('#' * m, '.' * (m - 1) + '#')
for i in range(n):
	print(b if i % 2 else a)
	if i % 2:
		b = b[::-1]


b = list(map(int, input().split(' ')))
x = b[1]
y = b[0]
for i in range(1, y + 1):
	for j in range(1, x + 1):
		print('#' if i % 2 == 1 or (i % 4 == 0 and j == 1) or (i % 4 == 2 and j == x) else '.', end='')
	print()


(n, m) = [int(x) for x in input().split()]
(g, h) = (1, 1)
for i in range(n):
	if g == 1:
		s = str()
		for k in range(m):
			s += '#'
		print(s)
		g = 0
	elif h == 1:
		s = str()
		for k in range(m - 1):
			s += '.'
		print(s + '#')
		h = 0
		g = 1
	else:
		s = '#'
		for k in range(m - 1):
			s += '.'
		print(s)
		h = 1
		g = 1


o = input().split()
m = int(o[0])
n = int(o[1])
for x in range(1, m + 1):
	for y in range(1, n + 1):
		if x % 2 == 1:
			print('#', end='')
		elif x % 4 == 0:
			print('#', end='')
			for t in range(n - 1):
				print('.', end='')
			break
		else:
			for t in range(n - 1):
				print('.', end='')
			print('#', end='')
			break
	print()


str = input()
str = str.split()
n = int(str[0])
m = int(str[1])
left = True
for i in range(n):
	if i % 2 == 1:
		if left:
			for j in range(m - 1):
				print('.', end='')
			print('#', end='')
			left = False
		else:
			print('#', end='')
			for j in range(m - 1, 0, -1):
				print('.', end='')
			left = True
	else:
		for j in range(m):
			print('#', end='')
	print()


isDebug = False
(n, m) = str(input()).split()
n = int(n)
m = int(m)
le = '#' * m
lo_r = '.' * (m - 1) + '#'
lo_l = '#' + '.' * (m - 1)
if isDebug:
	print(f'le={le}, lo_r={lo_r}, lo_l={lo_l}')
isRight = True
for i in range(0, n):
	if i % 2 == 0:
		print(le)
	elif isRight:
		print(lo_r)
		isRight = not isRight
	else:
		print(lo_l)
		isRight = not isRight


(n, m) = map(int, input().split())
turn = False
passed = False
for i in range(n):
	if not passed:
		print('#' * m)
		passed = True
	else:
		if not turn:
			print('.' * (m - 1) + '#')
			turn = True
		else:
			print('#{}'.format('.' * (m - 1)))
			turn = False
		passed = False


(n, m) = input().split()
n = int(n)
m = int(m)
c = 1
for x in range(1, n + 1):
	for y in range(1, m + 1):
		if x % 2 == 0:
			if c % 2 != 0:
				for _ in range(1, m):
					print('.', end='')
				print('#', end='')
				c += 1
				break
			else:
				print('#', end='')
				for _ in range(1, m):
					print('.', end='')
				c += 1
				break
		else:
			print('#', end='')
	print(' ')


(m, n) = [int(x) for x in input().split()]
b = -1
c = -3
for i in range(m):
	if i % 2 == 0:
		print('#' * n)
	elif b % 4 == 0:
		print('.' * (n - 1) + '#')
	elif c % 4 == 0:
		print('#' + '.' * (n - 1))
	b += 1
	c += 1


(n, m) = map(int, input().split(' '))
i = 1
flip = True
while i <= n:
	if i % 2 != 0:
		print('#' * m)
	elif flip:
		print('.' * (m - 1) + '#')
		flip = False
	else:
		print('#' + '.' * (m - 1))
		flip = True
	i += 1


(n, m) = input().strip().split()[:2]
n = int(n)
m = int(m)
k = '#' * m
l = '.' * (m - 1) + '#'
for x in range(1, n + 1):
	if x % 2 == 0:
		print(l)
		l = l[::-1]
	else:
		print(k)


(n, m) = map(int, input().split())
l = 1
for i in range(1, n + 1):
	if i & 1:
		print('#' * m)
	elif l == 1:
		print('.' * (m - 1) + '#')
		l = 0
	else:
		print('#' + '.' * (m - 1))
		l = 1


def fun(n, d):
	s1 = '#' * d
	s2 = '.' * (d - 1) + '#'
	s3 = s2[::-1]
	si = [s1, s2, s1, s3]
	for i in range(0, n):
		print(si[i % 4])
(n, d) = list(map(lambda x: int(x), input().split()))
fun(n, d)


def FoxAndSnake(r, c):
	f = 1
	for i in range(r):
		s = ''
		if i % 2 == 0:
			for j in range(c):
				s = s + '#'
		if i % 2 == 1 and f % 2 == 1:
			for j in range(c - 1):
				s = s + '.'
			s = s + '#'
			f = f + 1
		elif i % 2 == 1 and f % 2 == 0:
			s = s + '#'
			for j in range(c - 1):
				s = s + '.'
			f = f + 1
		print(s)
(x, y) = input().split()
FoxAndSnake(int(x), int(y))


(n, m) = map(int, input().split())
lisofi = []
for i in range(1, n + 1):
	if i % 4 == 0:
		lisofi.append('#' + '.' * (m - 1))
	elif i % 2 == 0:
		lisofi.append('.' * (m - 1) + '#')
	else:
		lisofi.append('#' * m)
for j in range(len(lisofi)):
	print(lisofi[j])


(n, m) = map(int, input().split())
a = [['.'] * (m + 1) for i in range(n)]
l = 1
for i in range(n):
	for j in range(1, m + 1):
		if i % 2 == 0:
			a[i][j * l] = '#'
		else:
			a[i][j * l] = '#'
			break
	else:
		l *= -1
	a[i].pop(0)
for i in range(n):
	print(*a[i], sep='')


(m, n) = [int(x) for x in input().split()]
counter = 0
for row in range(1, m + 1, 1):
	if row % 2 != 0:
		print(''.join(('#' for column in range(0, n, 1))))
	elif counter % 2 == 0:
		a = ''.join(('.' for column in range(0, n - 1, 1)))
		print(a + '#')
		counter += 1
	elif counter % 2 != 0:
		b = ''.join(('.' for column in range(0, n - 1, 1)))
		counter += 1
		print('#' + b)
	else:
		pass


s1 = input()
r = int(s1.split()[0])
c = int(s1.split()[1])
i = 1
while i <= r:
	if i % 2 == 1:
		print('#' * c)
	elif i % 4 != 0:
		print('.' * (c - 1) + '#')
	else:
		print('#' + '.' * (c - 1))
	i += 1


inputNums = input()
q = []
for i in inputNums.split(' '):
	q.append(i)
n_ = q[0]
n = int(n_)
m_ = q[1]
m = int(m_)
flag = 0
for i in range(n):
	if i % 2 == 0:
		print(m * '#')
	elif flag == 0:
		print((m - 1) * '.' + '#')
		flag = 1
	else:
		print('#' + (m - 1) * '.')
		flag = 0


(r, c) = map(int, input().split())
body1 = '#' * c
body2 = '.' * (c - 1) + '#'
body3 = '#' + '.' * (c - 1)
for i in range(1, r + 1):
	if i % 4 == 1 or i % 4 == 3:
		print(body1)
	if i % 4 == 2:
		print(body2)
	if i % 4 == 0:
		print(body3)


(n, m) = [int(x) for x in input().split()]
for i in range(1, n + 1):
	if i % 2 == 1:
		lis = ['#'] * m
		print(''.join((str(i) for i in lis)))
	if i % 4 == 2:
		lis = ['.'] * (m - 1) + ['#']
		print(''.join((str(i) for i in lis)))
	if i % 4 == 0:
		lis = ['#'] + ['.'] * (m - 1)
		print(''.join((str(i) for i in lis)))


(r, col) = map(int, input().split())
c = 1
for i in range(r):
	if i % 2 == 0:
		for j in range(col):
			print('#', end='')
	else:
		c = c + 1
		if c % 2 == 0:
			for j in range(col - 1):
				print('.', end='')
			print('#', end='')
		else:
			print('#', end='')
			for j in range(col - 1):
				print('.', end='')
	print('\t')


a = input().split()
n = int(a[0])
m = int(a[1])
f = True
for i in range(n):
	if i % 2 == 1:
		if f:
			s = '.' * (m - 1) + '#'
			f = False
		elif not f:
			s = '#' + '.' * (m - 1)
			f = True
	else:
		s = '#' * m
	print(s)


(n, m) = map(int, input().split())
wave = 0
for x in range(n):
	if x % 2 == 0:
		print('#' * m)
	else:
		if wave % 2 == 0:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		wave = wave + 1


(n, t) = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if i % 2 == 1:
		print('#' * t)
	elif i % 4 == 2:
		print('.' * (t - 1), end='')
		print('#')
	elif i % 4 == 0:
		print('#', end='')
		print('.' * (t - 1))


(n, m) = map(int, input().split())
li = []
lu = []
for i in range(m):
	li.append('#')
	lu.append('.')
j = ''.join(li)
lu[0] = '#'
k = ''.join(lu)
lu[-1] = '#'
lu[0] = '.'
l = ''.join(lu)
for i in range(n):
	if i % 2 == 0:
		print(j)
	elif (i + 1) % 4 == 0:
		print(k)
	else:
		print(l)


body = '#'
empty = '.'
(a, b) = tuple(map(int, input().split()))
for i in range(a):
	if i % 2 == 0:
		print(body * b)
	elif (i - 1) % 4 == 0:
		print(empty * (b - 1) + body)
	elif (i - 3) % 4 == 0:
		print(body + empty * (b - 1))


import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect
MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda : sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 8)
(n, m) = map(int, input().split())
ans = []
for i in range(n):
	if i % 2 == 0:
		ans.append(['#'] * m)
	elif i % 4 == 1:
		ans.append(['.'] * (m - 1) + ['#'])
	else:
		ans.append(['#'] + ['.'] * (m - 1))
for i in ans:
	print(''.join(i))


line = input().split()
(m, n) = (int(line[0]), int(line[1]))
(h, d) = ('#', '.')

def sc(x):
	switch = {0: h + d * (n - 1), 1: h * n, 2: d * (n - 1) + h, 3: h * n}
	return switch.get(x + 1 & 3)
for i in range(m):
	print(sc(i))


(num1, num2) = input().split()
(num1, num2) = (int(num1), int(num2))
x = 0
r = 0
for i in range(num1):
	if x == 0:
		print('#' * num2)
		x = 1
	else:
		x = 0
		if r == 0:
			print('.' * (num2 - 1), '#', sep='')
			r = 1
		else:
			print('#', '.' * (num2 - 1), sep='')
			r = 0


x = input().split()
y = int(x[0])
z = int(x[1])
i = 0
j = 1
a = '#' * z
b = '.' * (z - 1)
while i < y:
	if i % 2 == 0:
		print(a)
	elif j % 2 == 1:
		print(b + '#')
		j += 1
	else:
		print('#' + b)
		j += 1
	i += 1


(line, times) = map(int, input().split())
headortail = 0
for i in range(line):
	if (i + 1) % 2 == 1:
		for e in range(times):
			print('#', end='')
		print()
	elif headortail == 0:
		for l in range(times - 1):
			print('.', end='')
		print('#')
		headortail = 1
	else:
		print('#', end='')
		for l in range(times - 1):
			print('.', end='')
		print()
		headortail = 0


x = list(map(int, input().split(' ')))
y = []
b = 0
for i in range(x[0]):
	a = []
	for j in range(x[1]):
		a.append('.')
	y.append(a)
for i in range(x[0]):
	if i % 2 == 0:
		for j in range(x[1]):
			y[i][j] = '#'
	else:
		if b % 2 == 0:
			y[i][x[1] - 1] = '#'
		else:
			y[i][0] = '#'
		b += 1
for i in y:
	print(''.join(i), end='\n')


(n, m) = [int(x) for x in input().split()]
k = -1
for i in range(n):
	if i % 2:
		if k == -1:
			print('.' * (m - 1) + '#')
		else:
			print('#' + '.' * (m - 1))
		k *= -1
	else:
		print('#' * m)


(n, m) = map(int, input().split())
left = True
for _ in range(1, n + 1):
	if _ % 2 == 1:
		print('#' * m)
	elif left:
		print('.' * (m - 1) + '#')
		left = False
	else:
		print('#' + '.' * (m - 1))
		left = True


x = input()
x = x.split(' ')
x = [int(i) for i in x]
indexi = x[0]
indexj = x[1]
changeindex = True
for i in range(0, indexi):
	if i % 2 != 0:
		if changeindex == True:
			changeindex = False
		else:
			changeindex = True
	for j in range(0, indexj):
		if i % 2 == 0:
			print('#', end='')
		elif changeindex == False:
			if j == indexj - 1:
				print('#', end='')
			else:
				print('.', end='')
		elif j == 0:
			print('#', end='')
		else:
			print('.', end='')
	print()


(n, m) = map(int, input().split())
l1 = [['.'] * m for _ in range(n)]
flag = 0
for i in range(n):
	if i % 2 == 0:
		l1[i] = ['#'] * m
	elif flag == 0:
		l1[i][-1] = '#'
		flag = 1
	else:
		flag = 0
		l1[i][0] = '#'
for item in l1:
	print(''.join(item))


(y, x) = map(int, input().split())
t = True
arr = []
for i in range(y):
	if i % 2 == 0:
		arr.append('#' * x)
	elif t == True:
		arr.append('.' * (x - 1) + '#')
		t = False
	elif t == False:
		arr.append('#' + '.' * (x - 1))
		t = True
for i in range(y):
	print(*arr[i], sep='')


(r, c) = map(int, input().strip().split())
a = [['#' for j in range(c)] for i in range(r)]
for i in range(1, r, 2):
	if (i + 1) % 4 == 0:
		for j in range(1, c):
			a[i][j] = '.'
	elif (i + 1) % 2 == 0:
		for j in range(c - 1):
			a[i][j] = '.'
for i in range(r):
	for j in range(c):
		print(a[i][j], end='')
	print()


(n, d) = map(int, input().split())
a = '#' * d
b = '#' + '.' * (d - 1)
j = 1
i = 0
while i < n:
	print(a)
	i += 1
	if i == n:
		break
	print([b, b[::-1]][j])
	j = (j + 1) % 2
	i += 1


(n, m) = map(int, input().split())
line = False
rorl = 'r'
for i in range(n):
	if line == False:
		print('#' * m)
		line = True
	elif rorl == 'r':
		rorl = 'l'
		line = False
		print('#'.rjust(m, '.'))
	else:
		rorl = 'r'
		line = False
		print('#'.ljust(m, '.'))


(n, m) = list(map(int, input().split()))
on = True
for irw in range(n):
	if irw % 2 == 0:
		print('#' * m)
	else:
		s = '.' * (m - 1)
		if on:
			s = s + '#'
		else:
			s = '#' + s
		print(s)
		on = not on


s = str(input())
s = s.split()
n = int(s[0])
m = int(s[1])
M = [['.' for x in range(m)] for x in range(n)]
flip = True
for i in range(0, n):
	if i % 2 == 0:
		print('#' * m)
	else:
		if flip:
			print('.' * (m - 1), '#', sep='')
		else:
			print('#', '.' * (m - 1), sep='')
		flip = not flip


(m, n) = map(int, input().split())
counter = False
point = '.'
for i in range(m):
	if i % 2 == 1:
		if counter == True:
			print('#' + point * (n - 1))
			counter = not counter
		else:
			print((n - 1) * point + '#')
			counter = not counter
	else:
		print('#' * n)


st = input()
i = 0
n = ''
m = ''
while st[i] != ' ':
	n = n + st[i]
	i += 1
i += 1
while i < len(st):
	m = m + st[i]
	i += 1
n1 = int(n)
m1 = int(m)
k = 0
p = 1
for i in range(n1):
	if i % 2 == 0:
		print('#' * m1)
	else:
		print('#' * k + '.' * (m1 - 1) + '#' * p)
		t = k
		k = p
		p = t


(n, m) = map(int, input().split())
snake = ''
for i in range(1, n + 1):
	if i % 2 != 0:
		snake += m * '#' + '\n'
	else:
		no = m - 1
		empty = no * '.'
		if i % 2 == 0 and i % 4 != 0:
			snake += empty + '#' + '\n'
		else:
			snake += '#' + empty + '\n'
print(snake)


(n, m) = [int(x) for x in input().split()]
place = m - 1
for i in range(n):
	if i % 2 == 0:
		print('#' * m)
	else:
		s = ['.'] * m
		s[place] = '#'
		place = 0 if place != 0 else m - 1
		print(''.join(s))


(c, b) = map(int, input().split())
a = list(range(b))
i = 0
while i < b:
	a[i] = '#'
	i += 1
d = list(range(b))
i = 0
while i < b:
	d[i] = '.'
	i += 1
i = 1
while i <= c:
	if i % 2 == 1:
		print(''.join(a))
	elif i % 4 == 2:
		d[b - 1] = '#'
		print(''.join(d))
		d[b - 1] = '.'
	elif i % 4 == 0:
		d[0] = '#'
		print(''.join(d))
		d[0] = '.'
	i += 1


a = input().split()
arr = [int(x) for x in a]
(row, col) = arr
end = True
for i in range(row):
	if i % 2 == 0:
		s = '#' * col
	else:
		if end:
			s = '.' * (col - 1) + '#'
		else:
			s = '#' + '.' * (col - 1)
		end = not end
	print(s)


(n, m) = map(int, input().split())
t1 = True
t2 = True
for i in range(n):
	if t1:
		print('#' * m)
		t1 = not t1
		continue
	elif t2:
		print('.' * (m - 1), end='')
		print('#')
		t2 = not t2
	else:
		print('#', end='')
		print('.' * (m - 1))
		t2 = not t2
	t1 = not t1


(n, m) = map(int, input().split(' '))
j = m - 1
l = '#' * m
l1 = '.' * (m - 1) + '#'
l2 = '#' + '.' * (m - 1)
i = 1
flag = 0
while i <= n:
	if i % 2:
		print(l)
	elif flag == 0:
		print(l1)
		flag = 1
	else:
		print(l2)
		flag = 0
	i = i + 1


n = list(map(int, input().strip().split()))[:2]
rowN = n[0]
colN = n[1]
s1 = ''
s2 = ''
s3 = '#'
for i in range(colN):
	s1 += '#'
for j in range(colN - 1):
	s2 += '.'
for i in range(1, rowN + 1):
	if i % 4 == 1 or i % 4 == 3:
		print(s1)
	if i % 4 == 2:
		print(s2 + s3)
	if i % 4 == 0:
		print(s3 + s2)


(n, m) = [int(x) for x in input().split()]
count = 0
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			print('#', end='')
		else:
			count += 1
			if count % 2 != 0:
				print('.' * (m - 1), end='')
				print('#', end='')
				break
			else:
				print('#', end='')
				print('.' * (m - 1), end='')
				break
	print()


(n, m) = list(map(int, input().split()))
tail = 0
for r in range(n):
	for c in range(m):
		if r % 2 == 0:
			print('#', end='')
		elif tail == 0:
			if c != m - 1:
				print('.', end='')
			else:
				print('#', end='')
				tail = 1
		elif c == 0:
			print('#', end='')
		else:
			print('.', end='')
			if c == m - 1:
				tail = 0
	print()


import sys
(N, M) = map(int, sys.stdin.readline().split())
count = 0
for i in range(N):
	if i % 2 == 0:
		print('#' * M)
	elif i % 2 != 0:
		if count == 0:
			print('.' * (M - 1) + '#')
			count = 1
		elif count == 1:
			print('#' + '.' * (M - 1))
			count = 0


angka = input().split(' ')
bawah = int(angka[0])
samping = int(angka[1])
kali = 1
for i in range(1, bawah + 1):
	for j in range(samping):
		if i % 2 == 1:
			print('#', end='')
		if i % 4 == 0:
			if j == 0:
				print('#', end='')
			else:
				print('.', end='')
		elif i % 2 == 0:
			if j == samping - 1:
				print('#', end='')
			else:
				print('.', end='')
	print()


(n, m) = map(int, input().split())
f = 0
for j in range(n):
	if j % 2 == 0:
		print('#' * m, end='')
	else:
		if f % 2 == 0:
			print('.' * (m - 1), '#', sep='', end='')
		else:
			print('#', '.' * (m - 1), sep='', end='')
		f += 1
	print()


def drawSnake(n, m):
	p = 'l'
	for i in range(0, n):
		if i % 2 == 0:
			print('#' * m)
		elif p == 'l':
			print('.' * (m - 1) + '#')
			p = 'r'
		else:
			print('#' + '.' * (m - 1))
			p = 'l'
(n, m) = map(int, input().split())
drawSnake(n, m)


(n, m) = input().split()
n = int(n)
m = int(m)
j = ['.' * (m - 1)] + ['#']
for s in range(n):
	if s % 2 == 0:
		print('#' * m)
	else:
		print(''.join(j))
		j.reverse()


s = input()
n1 = [int(i) for i in s.split()]
n = n1[0]
m = n1[1]
j = 0
s = '#'
t = '.'
for i in range(n):
	if i % 2 == 0:
		print(s * m)
	else:
		if j == 0:
			print(t * (m - 1) + s)
		else:
			print(s + t * (m - 1))
		j = (j + 1) % 2


(l, c) = map(int, input().split(' '))
for li in range(l):
	if li % 2 == 0:
		print('#' * c)
	elif li % 4 == 1:
		print('.' * (c - 1), '#', sep='')
	else:
		print('#', '.' * (c - 1), sep='')


(n, m) = [int(i) for i in input().split()]
i = 1
while i <= n:
	if i % 2 != 0:
		a = []
		j = m
		while j > 0:
			j -= 1
			a.append('#')
		print(''.join(a))
	elif i % 4 != 0:
		b = []
		j = m
		while j > 1:
			j -= 1
			b.append('.')
		b.append('#')
		print(''.join(b))
	else:
		c = []
		j = m
		c.append('#')
		while j > 1:
			j -= 1
			c.append('.')
		print(''.join(c))
	i += 1