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

int memo[501][501];

// [L, R)
bool func(string& s, int L, int R)
{
    if (R==L) return true;
    if (s[L]!='m' or s[R-1]!='w') return false;

    int& res=memo[L][R];
    if (~res) return res;
    for(int i=L+1; i<R-1; ++i)
        if (s[i]=='e' and func(s, L+1, i) and func(s, i+1, R-1))
            return res=true;
    return res=false;
}

int main()
{
    memset(memo, -1, sizeof(memo));
    string s; cin>>s;
    cout<<(func(s, 0, s.size()) ? "Cat" : "Rabbit")<<endl;
}
### Prompt

Your task is to create a cpp solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

int memo[501][501];

// [L, R)
bool func(string& s, int L, int R)
{
    if (R==L) return true;
    if (s[L]!='m' or s[R-1]!='w') return false;

    int& res=memo[L][R];
    if (~res) return res;
    for(int i=L+1; i<R-1; ++i)
        if (s[i]=='e' and func(s, L+1, i) and func(s, i+1, R-1))
            return res=true;
    return res=false;
}

int main()
{
    memset(memo, -1, sizeof(memo));
    string s; cin>>s;
    cout<<(func(s, 0, s.size()) ? "Cat" : "Rabbit")<<endl;
}
```