#ifdef __GNUC__ #pragma GCC optimize ("O3") #pragma GCC target ("avx") #endif #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include//assert(); #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// #ifdef getchar_unlocked #define mygc(c) (c)=getchar_unlocked() #else #define mygc(c) (c)=getchar() #endif #ifdef putchar_unlocked #define mypc(c) putchar_unlocked(c) #else #define mypc(c) putchar(c) #endif ///////// typedef long long LL; typedef long double LD; typedef unsigned long long ULL; ///////// using namespace::std; ///////// #ifdef _DEBUG #define DEBUG_BOOL(b) assert(b) #else #define DEBUG_BOOL(b) #endif /////数値読み込み #define ENABLE_READER_ON(T) \ inline void reader(T &x){int k;x = 0;bool flag = true;\ while(true){mygc(k);\ if( k == '-'){flag = false;break;}if('0' <= k && k <= '9'){x = k - '0';break;}\ }\ if( flag ){while(true){mygc(k);if( k<'0' || '9' inline T gcd(T a, T b){return b == 0 ? a : gcd(b, a % b);} // 最小公倍数 template inline T lcm(T a, T b){return a * b / gcd(a, b);} //////////////////////////////// class UTF8{ public: int size; vector str; string operator[](int i){ return str[i]; } int set(string strInput){ this->str = vector(0); int len = strInput.size(); unsigned char temp; for(int i=0;istr.push_back( (string)(strInput.substr( i, 1 )) ); }else if( 0xC2 <= temp && temp <= 0xDF ){ if( i+ 1 >= len ){ this->size = this->str.size(); return size; } this->str.push_back( strInput.substr( i, 2 ) ); i += 1; }else if(0xE0 <= temp && temp <= 0xEF ){ if( i+2 >= len ){ this->size = this->str.size(); return size; } this->str.push_back( strInput.substr( i, 3 ) ); i += 2; }else if(0xF0 <= temp && temp <= 0xF7 ){ if( i+3 >= len ){ this->size = this->str.size(); return size; } this->str.push_back( strInput.substr( i, 4 ) ); i+= 3; } } this->size = this->str.size(); return this->size; } void operator=(UTF8 utf8){ this->size = utf8.size; this->str = utf8.str; } void operator=(UTF8* utf8){ this->size = utf8->size; this->str = utf8->str; } UTF8 operator+(string str_s){ UTF8 ret; ret = this; ret.str.push_back(str_s); ret.size = ret.str.size(); return ret; } }; inline void solve(){ UTF8 utf8; string str; reader(str); int size = utf8.set(str); //ef bd 97 char w[] = {(char)0xef,(char)0xbd,(char)0x97}; string wStr(w,end(w)); int pos = 0; while( utf8[pos++] == wStr ); int MAX = 0; int tempMax = 0; vector maxUtf; for(pos;pos MAX ){ MAX = tempMax; maxUtf.resize(0); maxUtf.push_back( tempUtf ); }else if( tempMax == MAX ){ maxUtf.push_back( tempUtf ); } tempMax = 0; tempUtf.str.resize(0); tempUtf.size = 0; } } vector::iterator itr,end; vector::iterator strIt,strEnd; itr = maxUtf.begin(); end = maxUtf.end(); for(;itr != end;++itr){ strIt = itr->str.begin(); strEnd = itr->str.end(); for(;strIt != strEnd;++strIt){ cout << *strIt; } cout << endl; } } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;//小数を10進数表示 cout << setprecision(16);//小数をいっぱい表示する。16? solve(); return 0; }