#include<bits/stdc++.h>
using namespace std;
int n;
string s;

bool visited[501][501];
bool dp[501][501];
bool solve(int l,int r){
  if(r<l)return true;
  if(visited[l][r])return dp[l][r];
  visited[l][r]=true;
  if(s[l]!='m'||s[r]!='w')return false;
  for(int i=l+1;i<r;i++){
    if(s[i]!='e')continue;
    if(solve(l+1,i-1)&&solve(i+1,r-1))return dp[l][r]=true;
  }
  return false;
}

int main(){
  cin>>s;
  n=s.size();
  if(solve(0,n-1))cout<<"Cat"<<endl;
  else cout<<"Rabbit"<<endl;
  return 0;
}
### Prompt

Please formulate a cpp solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include<bits/stdc++.h>
using namespace std;
int n;
string s;

bool visited[501][501];
bool dp[501][501];
bool solve(int l,int r){
  if(r<l)return true;
  if(visited[l][r])return dp[l][r];
  visited[l][r]=true;
  if(s[l]!='m'||s[r]!='w')return false;
  for(int i=l+1;i<r;i++){
    if(s[i]!='e')continue;
    if(solve(l+1,i-1)&&solve(i+1,r-1))return dp[l][r]=true;
  }
  return false;
}

int main(){
  cin>>s;
  n=s.size();
  if(solve(0,n-1))cout<<"Cat"<<endl;
  else cout<<"Rabbit"<<endl;
  return 0;
}
```