Problem: 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

Solution (in PYTHON):

Solution:
while True:    
    try:
        s = raw_input()
    except:        
        break
    if len(s.rstrip().lstrip())==0:        
        break
    
    si = s.split()
    startCh = ord(si[0])
    offset  = int(si[1])
    if offset == 1:
    	print "INVALID"
    	print
    	continue
    endChi  = startCh + (offset-1)
    if not isinstance(offset, int):
        print "INVALID"
        print
        continue
    allrange = range(65,91) + range(97,123)
    if startCh not in allrange:
        print "INVALID"
        print
        continue
    if endChi not in allrange:
        print "INVALID"
        print
        continue
    print chr(startCh)   
    for i in range(1, offset):
        curr = [chr(startCh + i)] * (i+1)
        print " ".join(curr)
        
    print    
        
        
    
    
        
        

exit()