#include #define rep(i,n) for (int i=0;i<(n);i++) using namespace std; int main() { string s; cin >> s; int n = s.size(); assert(3 <= n && n <= 100000); bool flag = true; int i, j; for (i = 0; i < n && s[i] == 'c'; i++) { ; } for (j = n-1; j >= 0 && s[j] == 'w'; j--) { ; } cerr << i << " " << j << endl; assert(i - 1 == j); assert(s.find("ccw") != string::npos); }