#include <iostream>
#include <string>
#include <vector>
using namespace std;

bool check(string const& s, int& p) {
    //cout << "p: " << p << endl;
    if(s.size() >= p+3 && s.substr(p, 3) == "mew") {
        p += 3;
        return true;
    }

    if(s[p] != 'm') {
        return false;
    }
    p++;
    if(s[p] != 'e') {
        if(!check(s, p)) {
            return false;
        }
        if(s[p] != 'e') {
            return false;
        }
        p++;
        if(s[p] != 'w' && !check(s, p)) {
            return false;
        }
        if(s[p] != 'w') {
            return false;
        }
        p++;
        return true;
    } else {
        p++;
        if(s[p] != 'w' && !check(s, p)) {
            return false;
        }
        if(s[p] != 'w') {
            return false;
        }
        p++;
        return true;
    }
}

int main() {
    string S;
    cin >> S;
    int pos = 0;
    if(check(S, pos) && (pos == S.size() || pos == S.size()-1)) {
        cout << "Cat" << endl;
    } else {
        cout << "Rabbit" << endl;
    }
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;

bool check(string const& s, int& p) {
    //cout << "p: " << p << endl;
    if(s.size() >= p+3 && s.substr(p, 3) == "mew") {
        p += 3;
        return true;
    }

    if(s[p] != 'm') {
        return false;
    }
    p++;
    if(s[p] != 'e') {
        if(!check(s, p)) {
            return false;
        }
        if(s[p] != 'e') {
            return false;
        }
        p++;
        if(s[p] != 'w' && !check(s, p)) {
            return false;
        }
        if(s[p] != 'w') {
            return false;
        }
        p++;
        return true;
    } else {
        p++;
        if(s[p] != 'w' && !check(s, p)) {
            return false;
        }
        if(s[p] != 'w') {
            return false;
        }
        p++;
        return true;
    }
}

int main() {
    string S;
    cin >> S;
    int pos = 0;
    if(check(S, pos) && (pos == S.size() || pos == S.size()-1)) {
        cout << "Cat" << endl;
    } else {
        cout << "Rabbit" << endl;
    }
}

```