#K15516. Alternating Grid Pattern
Alternating Grid Pattern
Alternating Grid Pattern
Given two integers \(n\) and \(m\), generate an \(n \times m\) grid filled with the characters 'A' and 'B' forming an alternating pattern. Specifically, the character for the cell in row \(i\) and column \(j\) is determined by whether \(i+j\) is even or odd. When \(i+j\) is even, the cell contains 'A'; otherwise, it contains 'B'.
This pattern ensures that each row and each column contains at least one filled cell, and no two adjacent cells (horizontally or vertically) share the same character. Your task is to generate the grid based on the input dimensions.
inputFormat
The input consists of a single line with two space-separated integers \(n\) and \(m\) \((1 \leq n, m \leq 1000)\), representing the number of rows and columns of the grid, respectively.
outputFormat
Output \(n\) lines. Each line must contain a string of length \(m\) representing a row of the grid with the alternating pattern of 'A' and 'B'.
## sample1 1
A
</p>