# http://c...content-available-to-author-only...e.com/questions/51984/stretching-words/52011#52011

def f(s,t):
 for c in t:s=s.replace(c,'%',1)
 print s.replace('%','%s')%*(x*2for x in t)

f('abcdefghij', ['a','b','c'])
#output: aabbccdefghij

f('lizard', ['i','a','r','d'])
#output: liizaarrdd

f('coconut', ['c','o'])
#ouput: ccooconut or coccoonut or ccocoonut

f('onomatopoeia', ['o','o','a','o','o'])
#output: oonoomaatoopooeia

f('onomatopoeia', ['o','a','o'])
#output: oonomaatoopoeia or onoomaatoopoeia or oonomaatopooeia etc.