#P2102. 地砖铺设
地砖铺设
Description
After making a big profit at the arcade, Xiao Z finally won the furniture he wanted. Taking this opportunity, he wants to tidy up his room.
At the department store, you can buy square floor tiles in various colors. For the sake of aesthetics, Xiao Z does not want square tiles of the same color to be adjacent. So he asked Xiao C to help solve this.
Xiao C quickly solved the task. However, due to a kind of OCD, she wants the sequence of colors of all cells, when the floor is divided into a grid by length and width and read row by row and column by column, to be lexicographically smallest. She hopes you can help verify her plan.
Input Format
The first line contains two integers and , representing the length and the width of the room.
Output Format
Output lines, each with columns, representing a tiling plan. The plan must be the lexicographically smallest among all valid plans. (You may regard that the concatenated string formed by removing newlines from the output plan is lexicographically smallest.)
4 3
AAA
AAA
AAA
BCB
Hint
Constraints:
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号