n='\n';f=lambda x,y:x+n+n.join(x[:-i]for i in range(1,len(x)-1))+n+n.join(y[:i]for i in range(1,len(y)+1)) print(f('hello','heaven'))
Standard input is empty
hello hell hel he h he hea heav heave heaven
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!