s = gets.chop maxcount = 0 wstart = 0 wend = 0 tmp = 0 i = 0 while i < s.size if s[i] == "w" tmp += 1 if maxcount < tmp maxcount = tmp wend = i - 1 end else wsrart = i tmp = 0 end i += 1 end puts s[wstart,wend]