joj2471

2471: String triangle

Result TIME Limit MEMORY Limit Run Times AC Times JUDGE
3s 65536K 3037 604 Standard

You are asked to draw a right-angle triangle, the given materials is a special word. Just see the sample for detail.

Input

The first line of each test case is a positive integer n. n is zero means the end of input that you should not care. The next line is a word (no blank) whose length is no more than 80.

Output

Print a right-angle triangle whose height and width are n using given word. You should print each character in the word in turn, if the last character is used, the next is the first character. Print a blank line between each case.

Sample Input

6
WORLD
3
ABCD
0

Sample Output

W
OR
LDW
ORLD
WORLD
WORLDW

A
BC
DAB

Problem Source: skywind

This problem is used for contest: 101  157  168  179 

Submit / Problem List / Status / Discuss


你可能感兴趣的:(joj2471)