P27869 [洛谷] [GESP202303 Level 2] Drawing a Triangle
普及
题目描述

Problem Description

Given a positive integer $n$, please construct a triangle pattern using uppercase letters as described below (refer to the sample input and output for examples): The first row of the triangle pattern contains 1 letter, the second row contains 2 letters, and so on. In the triangle pattern, uppercase letters $\texttt{A}-\texttt{Z}$ are filled in sequentially from top to bottom and from left to right. After using the letter $\texttt{Z}$, the sequence restarts with $\texttt{A}$.

Input Format

A single line containing a positive integer $n$. It is guaranteed that $2 \le n \le 40$.

Output Format

Output the triangle pattern as described. Ensure that there are no trailing spaces at the end of each line.

Sample Input and Output

Sample Input #1

3

Sample Output #1

A
BC
DEF

Sample Input #2

7

Sample Output #2

A
BC
DEF
GHIJ
KLMNO
PQRSTU
VWXYZAB
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3
样例输出
A BC DEF