#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

using namespace std;

string S;

int rec(int l, int r) {
    static vector<vector<int>> dp(500, vector<int>(500, -1));
    auto& ret = dp[l][r];
    if (ret >= 0) return ret;

    if (r < l) return ret = 1;
    if ((r - l + 1) % 3 != 0 || S[l] != 'm' || S[r] != 'w') return ret = 0;

    ret = 0;
    for (int i = l + 1; i < r; ++i) {
        if (S[i] != 'e') continue;
        if (rec(l + 1, i - 1) && rec(i + 1, r - 1)) ret = 1;
    }
    return ret;
}

int main() {
    cin >> S;
    cout << (rec(0, S.size() - 1) ? "Cat" : "Rabbit") << endl;
    return 0;
}


### Prompt

Develop a solution in CPP to the problem described below:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using lint = long long;
using ldouble = long double;

using namespace std;

string S;

int rec(int l, int r) {
    static vector<vector<int>> dp(500, vector<int>(500, -1));
    auto& ret = dp[l][r];
    if (ret >= 0) return ret;

    if (r < l) return ret = 1;
    if ((r - l + 1) % 3 != 0 || S[l] != 'm' || S[r] != 'w') return ret = 0;

    ret = 0;
    for (int i = l + 1; i < r; ++i) {
        if (S[i] != 'e') continue;
        if (rec(l + 1, i - 1) && rec(i + 1, r - 1)) ret = 1;
    }
    return ret;
}

int main() {
    cin >> S;
    cout << (rec(0, S.size() - 1) ? "Cat" : "Rabbit") << endl;
    return 0;
}


```