#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

string str;
int checked[600][600];

string check(int l,int r){
	if(l-1==r)return "Cat";
	if(str[l]!='m' || str[r]!='w')return "Rabbit";
	if(checked[l][r]!=0){
		return checked[l][r]==1?"Cat":"Rabbit";
	}
	int flag=-1;
	for(int i=l+1;i<=r-1;i++){
		if(str[i]=='e'){
			if(check(l+1,i-1)=="Cat" && check(i+1,r-1)=="Cat")flag=1;
		}
	}
	return (checked[l][r]=flag)==1? "Cat":"Rabbit";
}

int main(void){
	cin >> str;
	cout << check(0,str.size()-1) << endl;
	return 0;
}
### Prompt

Generate a Cpp solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

string str;
int checked[600][600];

string check(int l,int r){
	if(l-1==r)return "Cat";
	if(str[l]!='m' || str[r]!='w')return "Rabbit";
	if(checked[l][r]!=0){
		return checked[l][r]==1?"Cat":"Rabbit";
	}
	int flag=-1;
	for(int i=l+1;i<=r-1;i++){
		if(str[i]=='e'){
			if(check(l+1,i-1)=="Cat" && check(i+1,r-1)=="Cat")flag=1;
		}
	}
	return (checked[l][r]=flag)==1? "Cat":"Rabbit";
}

int main(void){
	cin >> str;
	cout << check(0,str.size()-1) << endl;
	return 0;
}
```