var s,t="" while(0<1)println{t=readLine s=(""/:(t*7 zip s*2+0))((z,a)=>z+a._1+a._2)take Seq(s.size*2,t.size*2-1).max s}