#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 NN and MM, representing the length and the width of the room.

Output Format

Output NN lines, each with MM 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 50%50\% of the testdata, it is guaranteed that N,M5N, M \leq 5.
  • For 100%100\% of the testdata, it is guaranteed that 1N,M1001 \leq N, M \leq 100.

Translated by ChatGPT 5