for L in io.lines()do i=99 repeat i=i-1;S=L:sub(-L:len()/i)until L==S:rep(i)print(S)end