// yukicoder 342 (http://yukicoder.me/problems/564) #include #include #include #include #include #define all(a) (a).begin(), (a).end() #define rep(i,a) for(int i=0;i<(a);++i) std::wstring S; std::vector ss; std::vector vs; int main() { std::locale::global( std::locale("") ); std::wcin >> S; int idx = 0; while( idx < S.size() && S[idx] == L'w' ) ++idx; int ma = 0; while( idx < S.size() ) { std::wstring t; while( idx < S.size() && S[idx] != L'w' ) t += S[idx++]; ss.push_back( t ); int cnt = 0; while( idx < S.size() && S[idx] == L'w' ) ++cnt, ++idx; vs.push_back( cnt ); ma = std::max( ma, cnt ); } bool fl = false; rep( i, vs.size() ) if( vs[i] == ma ) { std::wcout << ss[i] << std::endl; fl = true; } if( !fl ) std::wcout << ""; return 0; }