artsy-lulu-1

Problem Description

Lulu says

"I love triangles. I love the alphabet, too. Today, I am feeling artsy and I want to mix up these two. Write me a program that draws left-aligned triangles using consecutive letters of the alphabet." 

Input Format

Each line of input consists of an alphabetic character ch, either in uppercase or lowercase, and an integer h indicating the height of the triangle. The two values are separated by a single space. 

If drawing the triangle with height h using consecutive characters from ch results to portions of the triangle containing non-alphabetic characters, input is also invalid. Height h should be at least 2.

Output Format

For each input, output the corresponding triangle. For invalid input, display "INVALID". Separate output for each test case with an empty line.

Constraints

ch = [a-z A-Z]

2 ≤ h ≤ 26

SAMPLE INPUT
f 1
A 3
n 5
w 7
v 5

SAMPLE OUTPUT
INVALID

A 
B B 
C C C 

n 
o o 
p p p 
q q q q 
r r r r r 

INVALID

v 
w w 
x x x 
y y y y 
z z z z z

Source: hackerearth | Difficulty: EASY


Solutions: