#C13380. Letter Pattern Construction

    ID: 42912 Type: Default 1000ms 256MiB

Letter Pattern Construction

Letter Pattern Construction

Given a positive integer n, construct a pattern of letters in n lines. The first line should contain only the letter A, the second line should contain A B, the third line A B C, and so on. Specifically, the i-th line should consist of the first i capital letters of the English alphabet, separated by a single space. If n is less than 1 or greater than 26, the program should output Invalid input.

The pattern can be mathematically described as follows:

For a valid n, for each line i (with \(1 \le i \le n\)), the output is:

[ L_i = \text{join}({ \text{chr}(65+j) : 0 \le j < i }, \ " ") ]

All lines are printed one below the other.

inputFormat

The input consists of a single integer n provided via standard input.

Constraints:

  • If \( n \lt 1 \) or \( n \gt 26 \), the program should output Invalid input.

outputFormat

If the input is valid, output the letter pattern with each line separated by a newline character. Otherwise, output Invalid input.

## sample
1
A