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

string S;
int dp[510][510];

bool rec(int l,int r){
    if(dp[l][r]!=-1) return dp[l][r];
    dp[l][r] = 0;
    if(l>r) return dp[l][r] = 1;
    if(S[l]!='m' || S[r]!='w') return dp[l][r] = 0;
    for(int i=l+1;i<r;i++){
        if(S[i]=='e') dp[l][r] = (dp[l][r] | (rec(l+1,i-1) & rec(i+1,r-1)));
    }
    return dp[l][r];
}

int main(){
    cin >> S;
    int N = S.size();
    for(int i=0;i<N;i++) for(int j=0;j<N;j++) dp[i][j] = -1;
    cout << (rec(0,N-1)? "Cat":"Rabbit") << endl;
    /*for(int i=0;i<N;i++){
        for(int j=i;j<N;j++) cerr << dp[i][j] << " ";
        cerr << endl;
    }*/
}

### Prompt

Generate a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

string S;
int dp[510][510];

bool rec(int l,int r){
    if(dp[l][r]!=-1) return dp[l][r];
    dp[l][r] = 0;
    if(l>r) return dp[l][r] = 1;
    if(S[l]!='m' || S[r]!='w') return dp[l][r] = 0;
    for(int i=l+1;i<r;i++){
        if(S[i]=='e') dp[l][r] = (dp[l][r] | (rec(l+1,i-1) & rec(i+1,r-1)));
    }
    return dp[l][r];
}

int main(){
    cin >> S;
    int N = S.size();
    for(int i=0;i<N;i++) for(int j=0;j<N;j++) dp[i][j] = -1;
    cout << (rec(0,N-1)? "Cat":"Rabbit") << endl;
    /*for(int i=0;i<N;i++){
        for(int j=i;j<N;j++) cerr << dp[i][j] << " ";
        cerr << endl;
    }*/
}

```