input:
a
b
c
d

target:

a
bb
ccc
dddd

how to get this logic. could anyone tell me this.

thank you...