Problem:
 Score : 500 points    Problem Statement You are given two integers A and B .  Print a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output section:   Let the size of the grid be h \times w ( h vertical, w horizontal). Both h and w are at most 100 .  The set of the squares painted white is divided into exactly A connected components.  The set of the squares painted black is divided into exactly B connected components.   It can be proved that there always exist one or more solutions under the conditions specified in Constraints section.
If there are multiple solutions, any of them may be printed.      Notes Two squares painted white, c_1 and c_2 , are called connected when the square c_2 can be reached from the square c_1 passing only white squares by repeatedly moving up, down, left or right to an adjacent square.  A set of squares painted white, S , forms a connected component when the following conditions are met:   Any two squares in S are connected.  No pair of a square painted white that is not included in S and a square included in S is connected.   A connected component of squares painted black is defined similarly.      Constraints  1 \leq A \leq 500  1 \leq B \leq 500         Input Input is given from Standard Input in the following format:  A  B       Output Output should be in the following format:   In the first line, print integers h and w representing the size of the grid you constructed, with a space in between.  Then, print h more lines. The i -th ( 1 \leq i \leq h ) of these lines should contain a string s_i as follows:  If the square at the i -th row and j -th column ( 1 \leq j \leq w ) in the grid is painted white, the j -th character in s_i should be . .  If the square at the i -th row and j -th column ( 1 \leq j \leq w ) in the grid is painted black, the j -th character in s_i should be # .           Sample Input 1 2 3      Sample Output 1 3 3
##.
..#
#.#  This output corresponds to the grid below:          Sample Input 2 7 8      Sample Output 2 3 5
#.#.#
.#.#.
#.#.#       Sample Input 3 1 1      Sample Output 3 4 2
..
#.
##
##       Sample Input 4 3 14      Sample Output 4 8 18
..................
..................
....##.......####.
....#.#.....#.....
...#...#....#.....
..#.###.#...#.....
.#.......#..#.....
#.........#..####.

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


def A():
    a,b,c,d = IR(4)
    print(min(a,b)+min(c,d))


def B():
    n = I()
    d,x = LI()
    a = IR(n)
    for i in range(1,d+1):
        for j in a:
            if (i-1)%j == 0:
                x += 1
    print(x)

def C():
    n = I()
    a = LI()
    ans = abs(a[0])
    for i in range(n-1):
        ans += abs(a[i+1]-a[i])
    ans += abs(a[-1])
    a.insert(0,0)
    a.append(0)
    for i in range(1,n+1):
        if a[i-1] <= a[i] <= a[i+1] or a[i+1] <= a[i] <= a[i-1]:
            print(ans)
        else:
            print(ans-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1]))

def D():
    a,b = LI()
    ans = [["."]*50+["
    for i in range(100):
        for j in range(50):
            if b == 1:break
            if i%2 == 0 and j%2 == 0:
                ans[i][j] = "
                b -= 1
        if b == 1:
            break
    for i in range(100):
        for j in range(50,100):
            if a == 1:break
            if i%2 == 0 and j%2 == 1:
                ans[i][j] = "."
                a -= 1
        if a == 1:
            break
    print(100,100)
    for i in ans:
        for j in i:
            print(j,end = "")
        print()

def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    D()

Solution (Python):
a,b = map(int,input().split())
li = []
for i in range(100*100):
    h = i//100
    w = i%100
    if(w<50):
        li.append('.')
    else:
        li.append('
nokori = b-1
for i in range(100):
    if(nokori == 0):
        break
    if(i%2 == 1):
        continue
    for j in range(50):
        if(j%2 == 1):
            continue
        if(nokori == 0):
            break
        nokori -= 1
        li[i*100+j]='
nokori = a-1
for i in range(100):
    if(nokori == 0):
        break
    if(i%2 == 0):
        continue
    for j in range(50,100):
        if(j%2 == 0):
            continue
        if(nokori == 0):
            break
        nokori -= 1
        li[i*100+j]='.'
print(100,100)
ans = ["" for i in range(100)]
for i in range(100):
    for j in range(100):
        ans[i] += li[i*100+j]
for hoge in ans:
    print(hoge)

Solution (Python):
def grid_components(A: int, B: int) -> list:
    K = 32
    grid = [
        ['
        for k in range(2 * K)]

    r, c = 0, 0
    for _ in range(A - 1):
        grid[r][c] = '.'

        c += 2
        if c >= 2 * K:
            r += 2
            c = 0

    r, c = 0, 0
    for _ in range(B - 1):
        grid[(2*K-1) - r][(2*K-1) - c] = '
        c += 2
        if c >= 2 * K:
            r += 2
            c = 0

    return grid


if __name__ == "__main__":
    A, B = map(int, input().split())
    ans = grid_components(A, B)
    h, w = len(ans), len(ans[0])
    print(h, w)
    for row in ans:
        print(''.join(row))

Solution (Python):
a, b = map(int, input().split())
k = 50
grid = [["

for i in range(a-1):
    row = 2*(i//k)
    col = 2*(i % k)
    grid[row][col] = "."

for i in range(b-1):
    row = 2*(i//k) + k+1
    col = 2*(i % k)
    grid[row][col] = "

print(2*k, 2*k)
for i in range(2*k):
    s = "".join(grid[i])
    print(s)

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))

a,b = rl()

a -= 1
b -= 1

print("{} {}".format(100,100))
for i in range(100):
    s = ''
    for j in range(100):
        if j < 50:
            if j%2==0 and i%2==0 and j<49 and a>0:
                s += '.'
                a -= 1
            else:
                s += '
        else:
            if j%2==0 and i%2==0 and j>51 and b>0:
                s += '
                b -= 1
            else:
                s += '.'
    print(s)

Solution (Python):
a, b = map(int, input().split())
a -= 1
b -= 1
size = 100
grid = [[['.'], ['
for i in range(a):
    grid[size - 1 - (i // (size//2)) * 2][size - 1 - (i % (size//2)) * 2] = '.'
for i in range(b):
    grid[(i // (size//2)) * 2][(i % (size//2)) * 2] = '
print(size, size)
for i in range(size):
    for j in range(size):
        print(grid[i][j], end = '')
    print()

Solution (Python):
a,b=map(int,input().split())
h=100
w=100
g=h*w
A=[0 for i in range(g)]

a-=1
b-=1
ii=0
jj=0
for i in range(a):
   A[ii]=1
   ii+=2
   if i%(w//2)==w//2-1 :
       ii+=1+w
for i in range(b):
   A[-1*(jj+1)]=1
   jj+=2
   if i%(w//2)==w//2-1 :
       jj+=1+w


print("{} {}".format(h,w))
ans=""
for i in range(g):
    if i%w==0 and i!=0 :
        print(ans)
        ans=""
    
    if i>=g//2 :
        A[i]=(A[i]+1)%2
    if A[i]==1 :
        ans+="."
    else :
        ans+="

print(ans)

Solution (Python):

a, b = map(int, input().split())
a -= 1
b -= 1
print("{} {}".format(100, 100))
for i in range(100):
    s = ''
    for j in range(100):
        if j < 50:
            if j % 2 == 0 and i % 2 == 0 and j < 49 and a > 0:
                s += '.'
                a -= 1
            else:
                s += '
        else:
            if j % 2 == 0 and i % 2 == 0 and j > 51 and b > 0:
                s += '
                b -= 1
            else:
                s += '.'
    print(s)

Solution (Python):



def main():
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    n = 100
    grid = [['.'] * n for _ in range(n // 2)]

    for _ in range(n // 2):
        grid.append(['

    print(n, n)

    for i in range(0, n // 2, 2):
        for j in range(0, n, 2):
            if b > 0:
                grid[i][j] = '
                b -= 1
            else:
                break

    for i in range(51, n, 2):
        for j in range(0, n, 2):
            if a > 0:
                grid[i][j] = '.'
                a -= 1
            else:
                break

    for g in grid:
        print(''.join(map(str, g)))


if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
a -= 1
b -= 1


B = [['


for h in range(0, 49, 2):
    tmp = 0
    while a != 0 and tmp < 100:
        B[h][tmp] = '.'
        a -= 1
        tmp += 2


for h in range(51, 100, 2)[::-1]:
    tmp = 0
    while b != 0 and tmp < 100:
        B[h][tmp] = '
        b -= 1
        tmp += 2

print(100, 100)
for b in B:
    print(*b, sep='')

Solution (Python):
B, A = map(int, input().split())

L = [['.' for i in range(100)] for j in range(100)]

for i in range(100):
    for j in range(100):
        if i >=50:
            L[i][j] = '
            
count = 1
now = 0
for i in range(49):
    for j in range(100):
        if count == A:
            break
        if  now%2 == 0 and j%2 == 0:
            L[now][j] = '
            count += 1
    now += 1

    if count == A:
        break  
        
count = 1
now = 51
for i in range(51, 100):
    for j in range(100):
        if count == B:
            break
        if  now%2 == 0 and j%2 == 0:
            L[now][j] = '.'
            count += 1

    now += 1
    if count == B:
        break  

print(100, 100)
for i in range(100):
    res = ''
    for j in range(100):
        res += L[i][j]
    print(res)

Solution (Python):
A, B = list(map(int, input().split()))

if A < B:
  x = A
  y = B
  c = [".", "
else:
  x = B
  y = A
  c = ["
  
S = []

if x <= 50:
  y -= 1
elif x % 50 != 0:
  y += 50 - x % 50

cnt = 0
while x > 50:
  S.append([c[0] if (i + cnt) % 2 == 0 else c[1] for i in range(100)])
  x -= 50
  y -= 50
  cnt += 1

if x != 1:
  S.append([c[0] if (i + cnt) % 2 == 0 and i < (x - 1) * 2 else c[1] for i in range(100)])
  cnt += 1

S.append([c[1] for i in range(100)])
cnt += 1
S.append([c[0] for i in range(100)])
cnt += 1

while y >= 1:
  S.append([c[1] if (i + cnt * 2) % 4 == 0 and i < y * 4 else c[0] for i in range(100)])
  y -= 25
  cnt += 1
  
print(cnt, 100)
for i in S:
  print("".join(i))

Solution (Python):
b,w=map(int,input().split())
H = 100
bc = wc = 1
print(100,100)
for i in range(H):
    s=""
    for j in range(H):
        if i < 50:
            if i %2!=0 and j%2!=0 and wc<w and j !=99:
                s+='
                wc+=1
            else:s+='.'
        else:
            if i %2!=0 and j%2!=0 and bc <b  and j!=99:
                s+='.'
                bc+=1
            else:s+='
    print(s)

Solution (Python):
a,b=map(int, input().split())
k=50
MAP=[]
for _ in range(k):
    MAP.append(["
for _ in range(k):
    MAP.append(["."]*2*k)
a-=1
b-=1
for i in range(0,k-1,2):
    for j in range(0,2*k,2):
        if a>0:
            MAP[i][j]="."
            a-=1
for i in range(k+1,2*k,2):
    for j in range(0,2*k,2):
        if b>0:
            MAP[i][j]="
            b-=1
print(2*k,2*k)
for i in MAP:
    print("".join(i))

Solution (Python):
A, B = map(int, input().split())
k = 50
d = [["." if i < k else "
A -= 1
B -= 1
for i in range(0, 50, 2):
    for j in range(0, 100, 2):
        if B > 0:
            d[i][j] = "
            B -= 1

for i in range(51, 100, 2):
    for j in range(0, 100, 2):
        if A > 0:
            d[i][j] = "."
            A -= 1

print(2 * k, 2 * k)
for s in d:
    print("".join(s))

Solution (Python):
A, B = map(int, input().split())
print(100,100)

L = [['
i = 0
k = 0
for _ in range(A-1):
    try :
        L[i][k] = '.'
        k += 2
    except:
        i += 2
        k = 0
        L[i][k] = '.'
        k += 2
L = L[::-1]
i = 0
k = 0
for _ in range(B-1):
    try :
        L[i][k] = '
        k += 2
    except:
        i += 2
        k = 0
        L[i][k] = '
        k += 2
for x in L:
    for y in x:
        print(y,end ='')
    print()

Solution (Python):
A,B = map(int,input().split())
X = []
for i in range(100):
    if i<50:
        X.append(["."]*100)
    else:
        X.append(["

A = A-1
q,r = A//50, A%50
for i in range(q):
    for j in range(50):
        X[99-i*2][j*2] = "."
for i in range(r):
    X[51][i*2] = "."

B = B-1
q,r = B//50, B%50
for i in range(q):
    for j in range(50):
        X[i*2][j*2] = "
for i in range(r):
    X[48][i*2] = "

print(100,100)
for x in X:
    print("".join(x))

Solution (Python):


def main():
    na = list(map(int, input().split()))
    A, B = na[0], na[1]

    mp = []
    for i in range(41):
        lst = []
        for j in range(41):
            lst.append(0)
        for j in range(41):
            lst.append(1)
        mp.append(lst)

    a = b = 1

    if a < A:
        for n in range(3, 39 + 3, 3):
            for i in range(n):
                if a < A:
                    mp[n - i][41 + i + 1] = 0
                    a += 1
                else:
                    break
            if A <= a:
                break
    if a < A:
        for n in range(36, 0, -3):
            for i in range(n):
                if a < A:
                    mp[39 - i][41 + 39 - n + i + 1] = 0
                    a += 1
                else:
                    break
            if A <= a:
                break
    if b < B:
        for n in range(3, 39 + 3, 3):
            for i in range(n):
                if b < B:
                    mp[n - i][i + 1] = 1
                    b += 1
                else:
                    break
            if B <= b:
                break
    if b < B:
        for n in range(36, 0, -3):
            for i in range(n):
                if b < B:
                    mp[39 - i][39 - n + i + 1] = 1
                    b += 1
                else:
                    break
            if B <= b:
                break


    print('41 82')
    for lst in mp:
        s = ''
        for v in lst:
            s += '
        print(s)

if __name__ == '__main__':
    main()

Solution (Python):
import itertools

a, b = map(int, input().split())
k = 50
grid = [['.' if x < k else '

for x, y in itertools.product(range(0, k, 2), range(0, k * 2, 2)):
    if b == 1: break
    grid[x][y] = '
    b -= 1

for x, y in itertools.product(range(k + 1, k * 2, 2), range(0, k * 2, 2)):
    if a == 1: break
    grid[x][y] = '.'
    a -= 1

print(k * 2, k * 2)
for row in grid:
    print(''.join(row))

Solution (Python):
A,B=map(int,input().split())

s_list=[['
            +[['.' for i in range(100)] for j in range(50)]

print(100,100)

n=0
for i in range(A-1):
    if 2*i-100*(n//2)<100:
        s_list[n][2*i-100*(n//2)]='.'
    else:
        n+=2
        s_list[n][2*i-100*(n//2)]='.'

n=52
for i in range(B-1):
    if 2*i-100*((n-52)//2)<100:
        s_list[n][2*i-100*(n-52)//2]='
    else:
        n+=2
        s_list[n][2*i-100*(n-52)//2]='
for s in s_list:
    print(''.join(s))

Solution (Python):
A, B = map(int, input().split())

ans = [[None for _ in range(100)] for _ in range(100)]
for i in range(100):
    for j in range(100):
        ans[i][j] = '

A -= 1
B -= 1

i, j = 0, 0
while A > 0:
    ans[i][j] = '.'
    A -= 1

    j += 2
    if j >= 100:
        j = 0
        i += 2

i, j = 51, 0
while B > 0:
    ans[i][j] = '
    B -= 1

    j += 2
    if j >= 100:
        j = 0
        i += 2

print(100, 100)
for i in range(100):
    print(*ans[i], sep='')

Solution (Python):
A, B = map(int, input().split())

grid = [["
for i in range(50, 100):
    for j in range(100):
        grid[i][j] = "."

a_count = 0
for i in range(49):
    for j in range(100):
        if a_count >= A - 1:
            continue
        if i % 2 == 1 and j % 2 == 1:
            grid[i][j] = "."
            a_count += 1

b_count = 0
for i in range(51, 100):
    for j in range(100):
        if b_count >= B - 1:
            continue
        if i % 2 == 1 and j % 2 == 1:
            grid[i][j] = "
            b_count += 1

print(100, 100)
for i in range(100):
    print("".join(grid[i]))

Solution (Python):
A, B = map(int, input().split())
G1 = [['
G2 = [['.'] * 100 for i in range(50)]

A, B = A - 1, B - 1

h, w = 0, 0
for a in range(A):
    if w > 99:
        h += 2
        w = 0
    G1[h][w] = '.'
    w += 2

h, w = 1, 0
for b in range(B):
    if w > 99:
        h += 2
        w = 0
    G2[h][w] = '
    w += 2


print(100, 100)
for g in G1:
    print(''.join(g))
for g in G2:
    print(''.join(g))

Solution (Python):


A, B = map(int, input().split())

grid = [['.'] * 100 for i in range(100)]
for i in range(50, 100):
	for j in range(100):
		grid[i][j] = '
A -= 1
B -= 1

for i in range(1, B//50*2+1, 2):
	for j in range(100):
		if j % 2 == 0:
			grid[i][j] = '
for i in range(0, B%50*2, 2):
	grid[B//50*2+1][i] = '

for i in range(51, A//50*2+51, 2):
	for j in range(100):
		if j % 2 == 0:
			grid[i][j] = '.'
for i in range(0, A%50*2, 2):
	grid[A//50*2+51][i] = '.'

print(100, 100)
for i in range(100):
	print(''.join(grid[i]))

Solution (Python):
a, b = map(int, input().split())
w = []
for i in range(100):
    w.append([])
for i in range(100):
    for j in range(100):
        w[i].append([])

for i in range(100):
    for j in range(100):
        if i < 50:
            w[i][j] = "."
        else:
            w[i][j] = "

acnt = 0
bcnt = 0
for i in range(0, 50, 2):
    for j in range(0, 100, 2):
        if bcnt == b - 1:
            break
        else:
            w[i][j] = "
            bcnt += 1
    else:  
        continue  
    break  
for i in range(51, 100, 2):
    for j in range(0, 100, 2):
        if acnt == a - 1:
            break
        else:
            w[i][j] = "."
            acnt += 1
    else:  
        continue  
    break  

print(100, 100)
for i in range(100):
    print(( ''.join(w[i])))

Solution (Python):
a, b = map(int, input().split())
grid = [["
for i in range(50, 100):
	for j in range(100):
		grid[i][j] = "."
for i in range(a-1):
	grid[(i//50)*2][(i%50)*2] = "."
for i in range(b-1):
	grid[(i//50)*2+51][(i%50)*2] = "
print(100, 100)
for i in range(100):
	print("".join(grid[i]))

Solution (Python):
a,b = map(int,input().split())
k = 50
d = [['.' if i<k else '
a-=1
b-=1
for i in range(0,50,2):
    for j in range(0,100,2):
        if b>0:
            d[i][j] = '
            b-=1

for i in range(51,100,2):
    for j in range(0,100,2):
        if a>0:
            d[i][j] = '.'
            a-=1

print(2*k, 2*k)
for s in d:
    print("".join(s))

Solution (Python):
A,B=map(int,input().split())
Board_up=[["
Board_down=[["."]*99 for i in range(50)]
for a in range(1,A):
  i,j=(a-1)//50,(a-1)%50
  Board_up[2*i][2*j]="."
for b in range(1,B):
  i,j=(b-1)//50,(b-1)%50
  Board_down[2*i+1][2*j]="
print(100,99)
for i in Board_up:
  print("".join(i))
for i in Board_down:
  print("".join(i))

Solution (Python):
a,b = map(int,input().split())
a,b = a-1, b-1

w,x = a//50, a%50
y,z = b//50, b%50

print(100,100)
res = [['
res += [['.' for _ in range(100)] for i in range(50)]

for i in range(0,w*2,2):
    for j in range(0,100,2):
        res[i][j] = '.'
for j in range(0,x*2,2):
    res[2*w][j] = '.'

for i in range(99,99-y*2,-2):
    for j in range(0,100,2):
        res[i][j] = '
for j in range(0,z*2,2):
    res[99-y*2][j] = '

for l in res:
    print(''.join(l))

Solution (Python):
A, B = map(int, input().split())
K = 50
G = [['.' for j in range(2 * K)] for i in range(K)] + [['
x = 0
while B > 1:
  for y in range(min(K, B - 1)):
    G[x][x % 2 + 2 * y] = '
    B -= 1
  x += 2
x = 2 * K - 1
while A > 1:
  for y in range(min(K, A - 1)):
    G[x][x % 2 + 2 * y] = '.'
    A -= 1
  x -= 2
print(2 * K, 2 * K)
for i in range(2 * K):
  print(''.join(G[i]))

Solution (Python):
a,b = map(int,input().split())
c,d = (a-1)//50, (a-1)%50
e,f = (b-1)//50, (b-1)%50

print(100,100)
res = [['


for i in range(c):
    for j in range(0,100,2):
        res[i*2][j] = '.'
for i in range(d):
    res[c*2][c%2+i*2] = '.'

for i in range(e):
    for j in range(0,100,2):
        res[99-i*2][j] = '
for i in range(f):
    res[99-e*2][e%2+i*2] = '

for i in range(100):
    print(''.join(res[i]));

Solution (Python):
import sys
whi,bla=map(int,input().split())
if(bla==0):
    print("1 1")
    print(".")
    sys.exit()
elif(whi==0):
    print("1 1")
    print("
    sys.exit()



whi-=1
bla-=1

field=[]
while(whi//50 >0):
    field.append(["
    field.append(["
    whi-=50

field.append(["
field.append(["
field.append(["."]*100)

while(bla//50 >0):
    field.append(["
    field.append(["."]*100)
    bla-=50

field.append(["

print("{} 100".format(len(field)))
for i in range(len(field)):
    print("".join(field[i]))

Solution (Python):
"""
D - Grid Components

２つの大きな領域を描画後、点を打っていけば良いらしい
"""

a, b = map(int, input().split())

square_n = int((max(a, b) ** 0.5) * 2 + 1)



white_p = 1
black_p = 1
white_mat = [["." for n in range(square_n)] for m in range(square_n)]
black_mat = [["




def paint(target_p, current_p, matrix, char):
    for row in range(0, square_n, 2):
        for col in range(0, square_n, 2):
            
            if current_p != target_p:
                
                matrix[row][col] = char
                current_p += 1
            else:
                return

paint(a, white_p, black_mat, ".")
paint(b, black_p, white_mat, "

print(square_n*2, square_n)



for row in white_mat:
    print("".join(row))
for row in reversed(black_mat):
    print("".join(row))

Solution (Python):
a, b = map(int, input().split())

print(100, 100)

ans = [["" for i in range(100)] for j in range(100)]
for i in range(50):
    for j in range(100):
        ans[i][j] = "."
for i in range(50, 100):
    for j in range(100):
        ans[i][j] = "

a -= 1
b -= 1

for i in range(0, 49, 2):
    for j in range(100):
        if b == 0:
            break
        if (i+j) % 2 == 0:
            ans[i][j] = "
            b -= 1
    else:
        continue
    break

for i in range(51, 100, 2):
    for j in range(100):
        if a == 0:
            break
        if (i+j) % 2 == 1:
            ans[i][j] = "."
            a -= 1
    else:
        continue
    break

tans = ["" for i in range(100)]
for i in range(100):
    for j in range(100):
        tans[i] += ans[i][j]

for i in range(100):
    print(tans[i])

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a,b = li()
grid = []
for i in range(100):
    if i < 50:
        grid.append(["."]*100)
    else:
        grid.append(["
                     
for i in range(b-1):
    grid[i//25][2*(i%50)] = "

    
for j in range(a-1):
    grid[(-j-1)//25][2*(j%50)] = "."
    
    
print(100, 100)
for i in range(100):
    print("".join(grid[i]))

Solution (Python):
A,B = map(int,input().split())

H = W = 100
ans = [['.

A -= 1
B -= 1

i = j = 0
while B:
    ans[i][j] = '
    j += 2
    if j >= W:
        j = 0
        i += 2
    B -= 1

i = 52
j = 0
while A:
    ans[i][j] = '.'
    j += 2
    if j >= W:
        j = 0
        i += 2
    A -= 1

print(H,W)
for row in ans:
    print(''.join(row))

Solution (Python):
A, B = map(int, input().split())

G = [["."] * 100 for i in range(50)] + [["

A, B = A - 1, B - 1

for h in range(0, 50, 2):
    for w in range(0, 100, 2):
        if B != 0:
            G[h][w] = "
            B -= 1

for h in range(51, 100, 2):
    for w in range(0, 100, 2):
        if A != 0:
            G[h][w] = "."
            A -= 1

print(100, 100)
for g in G:
    print("".join(g))

Solution (Python):
A, B = map(int, input().split())
T = [["
for i in range(50, 100):
    T[i] = ["."] * 100

A -= 1
for i in range(50):
    if A == 0:
        break
    if i % 2 == 0:
        for j in range(100):
            if j % 2 == 0:
                T[i][j] = "."
                A -= 1
                if A == 0:
                    break

B -= 1
for i in range(51, 100):
    if B == 0:
        break
    if i % 2 != 0:
        for j in range(100):
            if j % 2 == 0:
                T[i][j] = "
                B -= 1
                if B == 0:
                    break

print(100, 100)
for i in range(100):
    print("".join(T[i]))

Solution (Python):
a, b = list(map(int, input().split()))

L = 100
l = L//2
ans = [['.']*L for _ in range(l)]
ans += [['


for i in range(a-1):
    h = (i//l)*2 + l+1
    w = (i%l)*2
    ans[h][w] = '.'
for i in range(b-1):
    h = (i//l)*2
    w = (i%l)*2
    ans[h][w] = '

print(L, L)
for a in ans:
    print(''.join(a))

Solution (Python):
h2 = 50
w2 = 50
ans = [["." for x in range(w2 * 2)] for y in range(h2 * 2)]

a, b = map(int, input().split())
a -= 1
if a != 0:
    b -= 1

cnt = 0
for y in range(h2):
    for x in range(w2):
        cnt += 1
        if cnt <= a:
            ans[y * 2][x * 2 + 1] = "
            ans[y * 2 + 1][x * 2] = "
            ans[y * 2 + 1][x * 2 + 1] = "
        elif a < cnt <= a + b:
            ans[y * 2 + 1][x * 2 + 1] = "


print(h2 * 2, w2 * 2)
for s in ans:
    print("".join(s))

Solution (Python):
A, B = map( int, input().split())
Board = [ ['
i = 0
nowj = 0
for _ in range(A-1):
    Board[i][nowj] = '.'
    if nowj == 98:
        nowj = 0
        i += 2
    else:
        nowj += 2
i = 51
nowj = 0
for _ in range(B-1):
    Board[i][nowj] = '
    if nowj == 98:
        nowj = 0
        i += 2
    else:
        nowj  += 2
print( '{} {}'.format(100, 100))
for i in range(100):
    print( ''.join(Board[i]))

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

A,B =inpl()
A -= 1
B -= 1

H,W = 41,100
ans = []

for y in range(H//2+1):
	tmp = []
	if y%2==0:
		tmp = ['.']*W
	else:
		for x in range(W):
			if x%2==1 and y%2==1 and B>0:
				tmp.append('
				B -= 1
			else:
				tmp.append('.')
	ans.append(tmp)

for y in range(H//2+1,H):
	tmp = []
	if y%2==1:
		tmp = ['
	else:
		for x in range(W):
			if x%2==1 and y%2==0 and A>0:
				tmp.append('.')
				A -= 1
			else:
				tmp.append('
	ans.append(tmp)

print(H,W)
for a in ans:
	print (''.join(a))

Solution (Python):
def d_grid_components(A, B):  
    H, W = 100, 100  
    
    grid = [['

    def fill(start, end, num, symbol):
        
        for h in range(start, end, 2):
            for w in range(1, W, 2):
                if num > 0:
                    grid[h][w] = symbol
                    num -= 1
                else:
                    return
        return None

    fill(1, 50, A - 1, '.')  
    fill(51, 100, B - 1, '

    ans = '100 100\n' + '\n'.join([''.join(row) for row in grid])
    return ans

A, B = [int(i) for i in input().split()]
print(d_grid_components(A, B))

Solution (Python):
B, A = map(int, input().split())

h, w = 100, 100
grid = [['.'] * 100 for _ in range(50)] + [['

for i in range(A - 1):
    A1, A2 = divmod(i, 50)
    grid[2 * A1][2 * A2] = '

for j in range(B - 1):
    B1, B2 = divmod(j, 50)
    grid[2 * B1 + 51][2 * B2] = '.'

print(h, w)
for i in range(100):
    print(''.join(grid[i]))

Solution (Python):
k=50
l=[["." if h<k else "
a,b=map(int,input().split())


aa=0
for y in range(k+1,k*2,2):
  if aa==a-1:break

  for x in range(0,2*k,2):
    if aa==a-1:break
    l[y][x]="."
    aa+=1

bb=0
for y in range(0,k-1,2):
  if bb==b-1:break
  for x in range(0,2*k,2):
    if bb==b-1:break
    l[y][x]="
    bb+=1

print(2*k,2*k)
for i in l:
  print("".join(i))

Solution (Python):
White, Black = map(int, input().split())

White -= 1
Black -= 1


W = "."
B = "

ans = []
for i in range(max(2 * (-(-1 * White // 50)), 2)):
    ans.append([B for i in range(100)])
for j in range(max(2 * (-(-1 * Black // 50)), 2)):
    ans.append([W for i in range(100)])


tmp = -2
row = 0
while(White != 0):
    if(tmp == 98):
        row += 2
        tmp = 0
    else:
        tmp += 2

    ans[row][tmp] = W
    White -= 1

row += 3
tmp = -2
while(Black != 0):
    
    if(tmp == 98):
        
        row += 2
        tmp = 0
    else:
        tmp += 2

    ans[row][tmp] = B
    Black -= 1

print(len(ans), 100)
for a in ans:
    print("".join(a))

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    A, B = map(int, input().split())

    ans = [[""] * 100 for _ in range(100)]
    for y in range(100):
        for x in range(100):
            if x < 50:
                ans[y][x] = "
            else:
                ans[y][x] = "."
    A -= 1
    B -= 1
    for y in range(1, 100, 2):
        for x in range(1, 100, 2):
            if 10 < x < 40:
                if A > 0:
                    ans[y][x] = "."
                    A -= 1
            if 60 < x < 90:
                if B > 0:
                    ans[y][x] = "
                    B -= 1

    print(100, 100)
    for line in ans:
        print("".join(line))


if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())

a -= 1
b -= 1

ans = [[ '

for i in range(1, 49):
    temp = [ '
    if a > 0:
        if i % 2 != 0:
            for j in range(min(a, 49)):
                temp[2 * j + 1] = '.'
                a -= 1
        else:
            ans.append(temp)
            continue
    else:
        break
    ans.append(temp)

ans.append([ '

ans.append([ '.' for _ in range(100)])

for i in range(1, 49):
    temp = [ '.' for _ in range(100)]
    if b > 0:
        if i % 2 != 0:
            for j in range(min(b, 49)):
                temp[2 * j + 1] = '
                b -= 1
        else:
            ans.append(temp)
            continue
    else:
        break
    ans.append(temp)

ans.append([ '.' for _ in range(100)])

print(len(ans), '100')

for x in ans:
    print(''.join(x))

Solution (Python):
a, b = list(map(int, input().split()))

white = "."
black = "
wb = white+black
wremaining = a - 1
bremaining = b - 1

print("100 100")
for i in range(25):
    if bremaining >= 50:
        print(wb*50)
        bremaining -=50
    elif bremaining > 0:
        s = wb*bremaining + white*(50-bremaining)*2
        print(s)
        bremaining = 0
    else:
        print(white*100)
    print(white*100)

for i in range(25):
    print(black*100)
    if wremaining >= 50:
        print(wb*50)
        wremaining -= 50
    elif wremaining > 0:
        s = wb*wremaining + black*(50-wremaining)*2
        print(s)
        wremaining = 0
    else:
        print(black*100)