We need to parse input lines each containing two integers H and W until both are 0. For each dataset, we need to output a chessboard of H rows and W columns, where the top-left corner is '#', and then alternating cells: '#', '.', '#', '.' etc. That means cell (i, j) (with i starting from 0 for top row, j starting from 0 for leftmost column) is '#' if (i+j) is even, and '.' if odd.
Print a blank line after each dataset.
Constraints: H,W up to 300. Multiple datasets.
We need to write a solution in Python. We'll read from sys.stdin, split lines, for each line, parse H and W, break if both zero. For each, generate lines: for i in range(H): line = ''.join('#' if (i+j)%2==0 else '.' for j in range(W)). Then print line. After each dataset, print a blank line (i.e., print() an extra newline). But careful: The problem says "Print a blank line after each dataset." That implies after the chessboard, output an empty line. Ensure that no extra blank line at end? Usually it's okay. We'll manage by printing an empty line after each dataset, including possibly after the last one? The problem may not mind trailing blank lines. But typical solutions often check if not last dataset. But it's simpler to print after each dataset, and if there is a dataset after, it will be fine. In example output, after each dataset there is a blank line, including after the last? In the example given, they show outputs separated by blank lines but likely they do not show trailing blank line. However, judges usually accept trailing whitespace. To be safe, we can print blank line after each dataset except maybe the last? But we don't know order. Could check if (H,W) != (0,0) after reading? But the last line is 0 0, not a dataset. So we print after each dataset (the ones before reading 0 0). So we can print after each dataset, and after the loop, we don't need to print anything else. That should be fine.
Edge Cases: H=1, W=1 => output "#" and then blank line. Good.
Implementation: We'll read all lines, or iterate line by line.
We'll use sys.stdin.
Now produce final answer: Provide a full Python code with explanation? The instruction says "You are an AI programming assistant. Provide code solution." Probably we need to output the code.
Thus final. ```python
import sys
def main():
out_lines = []
for line in sys.stdin:
line = line.strip()
if not line:
continue
H, W = map(int, line.split())
if H == 0 and W == 0:
break
board = []
for i in range(H):
row = ''.join('#' if (i + j) % 2 == 0 else '.' for j in range(W))
board.append(row)
out_lines.extend(board)
out_lines.append('') # blank line after each dataset
sys.stdout.write('\n'.join(out_lines))
if name == "main":
main()