s=0 ..io.read"*a"s:gsub("%a+",function(x)repeat y=x x=x:sub(1,-2)a,n=s:gsub("%A"..x,x)until n>1 print(y)end)