Page not loading? Try clicking here.
Placeholder

#1523

Star triangle 1s 64MB

Problems

Given the height n of a triangle and the type m, write a program that prints a triangle in one of the specified formats.


Input

You are given the triangle size n (a natural number not exceeding 100) and the type mmm (a natural number from 1 to 3).


Output

Print one of the three types of triangles according to the given height n and type m.

If the input values are outside the specified ranges, output INPUT ERROR!.


Example #1

3 2
***

**
*

Example #2

4 3
   *

***
*****
*******

Example #3

200 3
INPUT ERROR!

Example #4

3 1
*
**
***


Source

JUNGOL

You must sign in to write code.