n=1 while gets w=[n.to_s]+split while (z=w.size)>0 0.upto(z){|h|i=z-h v=w[0..i] o=v.join(' ') if o.size<=40 if i