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
#########
........#
#########
#........
#########
........#
#########
#........
#########

Difficulty: interview

Starter code:

Solutions:
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)+'#')
    else:
        print('#'+'.'*(b-1))


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 = 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(x) for x 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))

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 = 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


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)
    else:
        if i%4 == 2: print("."*(c-1) + "#")
        else: print("#" + "."*(c-1))

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


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 = tuple(int(x) for x in input().split())
right = True
while n:
    if n % 2 == 1:
        print('#' * m)
    else:
        if right:
            print('.'*(m-1), '#', sep = "")
            right = False
        else:
            print('#', '.'*(m-1), sep = "")
            right = True
    n -= 1


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

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


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


#!/usr/bin/env python

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))



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

for i in range(m):
    if(i%2 == 0):
        for i in range(n):
            print("#", end="")
    else:
        for j in range(n):
            if(i%4 == 1 and j == n - 1):
                print("#", end="")
            elif(i%4 ==3 and j == 0):
                print("#", end="")
            else:
                print(".", end="")
    print("")



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

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


a=input().split()

n=int(a[0])
m=int(a[1])

for i in range(n):
    if i%2==0:
        print("#"*m)
    else:
        if i%4==3:
            
            s="#"+"."*(m-1)
            print(s)
        else:
            s="."*(m-1)+"#"
            print(s)

#!/usr/bin/env python3

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

i = 0
while i < n:
    print('#' * m)
    if i != n - 1:
        if i / 2 % 2 == 0:
            print('.' * (m - 1) + '#')
        else:
            print('#' + '.' * (m - 1))
    i += 2


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

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


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))


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()

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)


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 = list(map(int,input().split()))
p = 0
s = ''
for i in range(m):
    s += snake(p,n)+'\n'
    p = (p+1)%4
    
print(s)