#B3844. Square Pattern with Rotating Alphabets
Square Pattern with Rotating Alphabets
Square Pattern with Rotating Alphabets
Given a positive integer \(n\), output an \(n \times n\) square pattern consisting of uppercase letters. The pattern starts as follows:
- The first row starts with the letter \(\texttt{A}\).
- The second row starts with the letter \(\texttt{B}\), the third row with \(\texttt{C}\), and so on.
- Within each row, every subsequent letter is the next letter in the alphabet. After \(\texttt{Z}\), the sequence wraps around to \(\texttt{A}\).
For example, if \(n = 3\), the output should be:
ABC BCD CDE
inputFormat
The input consists of a single line containing a positive integer \(n\) (\(1 \le n \le 100\)).
outputFormat
Output an \(n \times n\) square pattern. Each row of the pattern should be printed on a new line without spaces between the characters.
sample
3
ABC
BCD
CDE
</p>