#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

int dp[510][510];
string s;

bool rec(int l, int r){
    if(dp[l][r] != -1) return dp[l][r];
    if(l > r) return dp[l][r] = true;
    bool res = false;
    if(s[l] != 'm' || s[r] != 'w') return dp[l][r] = false;
    rep(i, l + 1, r){
        if(s[i] == 'e'){
            res |= (rec(l + 1, i - 1) && rec(i + 1, r - 1));
        }
    }
    return dp[l][r] = res;
}

signed main(){
    cin >> s;
    memset(dp, -1, sizeof(dp));
    cout << (rec(0, s.size() - 1) ? "Cat" : "Rabbit") << endl;
}
### Prompt

Please formulate a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

int dp[510][510];
string s;

bool rec(int l, int r){
    if(dp[l][r] != -1) return dp[l][r];
    if(l > r) return dp[l][r] = true;
    bool res = false;
    if(s[l] != 'm' || s[r] != 'w') return dp[l][r] = false;
    rep(i, l + 1, r){
        if(s[i] == 'e'){
            res |= (rec(l + 1, i - 1) && rec(i + 1, r - 1));
        }
    }
    return dp[l][r] = res;
}

signed main(){
    cin >> s;
    memset(dp, -1, sizeof(dp));
    cout << (rec(0, s.size() - 1) ? "Cat" : "Rabbit") << endl;
}
```