Page not loading? Try clicking here.
Placeholder

#1338

Character Triangle 1 1s 64MB

Problems

After receiving the height N of a triangle,
write a program that prints the triangle shape filled with characters starting from ‘A’,
filling along the left diagonal as shown below.

[Processing Conditions]

(1) Starting from the top-right, move toward the bottom-left,
 filling characters in order from ‘A’.

(2) After reaching the N-th row, start again from the second row from the right,
 and fill downward to the left.

(3) Repeat this process until the entire triangle is filled.
 (After ‘Z’, start again from ‘A’.)


Input

Receive the height N of the triangle (N is a positive integer not exceeding 100).


Output

Print the character triangle of height N in the given format.
Separate the characters with a single space.


Example

5
        A
B F
C G J
D H K M
E I L N O


Source

JUNGOL

You must sign in to write code.