-- "w" = 130 151 local str = io.read() local t = {} for i = 1, #str do t[i] = str:sub(i, i):byte() end local chain = 0 local stpos, edpos = 1 local i = 1 local wlist = {} local maxchain = 0 while(i < #str) do if(t[i] == 130 and t[i + 1] == 151) then if(chain == 0) then edpos = i - 1 end chain = chain + 1 i = i + 2 else if(0 < chain) then local len = edpos - stpos + 1 if(0 < len) then maxchain = math.max(chain, chain) if(wlist[chain] == nil) then wlist[chain] = {} end local tmp = {} tmp.st = stpos tmp.ed = edpos table.insert(wlist[chain], tmp) end stpos = i chain = 0 end i = i + 1 end end if(0 < chain) then local len = edpos - stpos + 1 if(0 < len) then maxchain = math.max(chain, chain) if(wlist[chain] == nil) then wlist[chain] = {} end local tmp = {} tmp.st = stpos tmp.ed = edpos table.insert(wlist[chain], tmp) end end if(maxchain == 0) then print("") else for k, v in pairs(wlist[maxchain]) do print(str:sub(v.st, v.ed)) end end