a=gets.chop gets$9 4.times{gsub a,' '*a.size s='' s+=$/while gsub!(/.$/){s+=$&;''} $_=s} print