Black and White Panel

Print the fixed 101-column black and white grid whose isolated single tiles yield exactly b black areas and w white areas.

Easy2ImplementationMatrixNo attempts yetTime limit2sMemory limit256 MB

Problem

You build a rectangular panel out of black and white square tiles of the same size. The finished panel must contain exactly bb 4-connected areas of black tiles and exactly ww 4-connected areas of white tiles.

A 4-connected area of one color is a maximal set of tiles that satisfies both conditions below.

  • All tiles of the set have the same color.
  • For any two tiles of the set there is a sequence of tiles of the set connecting them, and consecutive tiles of the sequence share a side.

Many panels meet these counts, so only the panel fixed by the output rule below is accepted.

Input

The first line contains the number of black areas bb and the number of white areas ww. (1b,w10001 \le b, w \le 1000)

Output

Print the number of rows rr and the number of columns cc of the panel on the first line, then print rr lines of cc characters each. A black tile is @ and a white tile is ..

The accepted panel is fixed by the rule below. Rows and columns are numbered from 1.

  • Let p=w1p = w - 1 and q=b1q = b - 1.
  • The panel always has c=101c = 101 columns.
  • The top black block has height h1=2p/50+1h_1 = 2\lceil p/50 \rceil + 1, the bottom white block has height h2=2q/50+1h_2 = 2\lceil q/50 \rceil + 1, and r=h1+h2r = h_1 + h_2.
  • Rows 11 through h1h_1 form the top block and start out all @. For each i=1,2,,pi = 1, 2, \dots, p, change the tile in row 2i/502\lceil i/50 \rceil and column 2(((i1)mod50)+1)2(((i-1) \bmod 50) + 1) to ..
  • Rows h1+1h_1 + 1 through rr form the bottom block and start out all .. For each j=1,2,,qj = 1, 2, \dots, q, change the tile in row h1+2j/50h_1 + 2\lceil j/50 \rceil and column 2(((j1)mod50)+1)2(((j-1) \bmod 50) + 1) to @.