<>;while($k=<>){ $_=<>;chop;$l=length; $k=$k>$l?$l:$k; /./; print$&x$k,substr($_,0,$l-$k),$/; }