#include <iostream>
#include <cstring>
#include <string>
using namespace std;
string S;
int dp[505][505];
bool is_cat(int l,int r)//[l,r)
{
	if(l==r)return true;
	if(S[l]!='m'||S[r-1]!='w')return false;
	if(dp[l][r]!=-1)return dp[l][r];
	for(int i=l+1;i<r-1;i++)
	{
		if(S[i]=='e')
		{
			if(is_cat(l+1,i)&&is_cat(i+1,r-1))return dp[l][r]=true;
		}
	}
	return dp[l][r]=false;
}
int main()
{
	memset(dp,-1,sizeof(dp));
	cin >> S;
	if(is_cat(0,(int)S.size()))cout << "Cat" << endl;
	else cout << "Rabbit" << endl;
	return 0;
}
### Prompt

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

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
string S;
int dp[505][505];
bool is_cat(int l,int r)//[l,r)
{
	if(l==r)return true;
	if(S[l]!='m'||S[r-1]!='w')return false;
	if(dp[l][r]!=-1)return dp[l][r];
	for(int i=l+1;i<r-1;i++)
	{
		if(S[i]=='e')
		{
			if(is_cat(l+1,i)&&is_cat(i+1,r-1))return dp[l][r]=true;
		}
	}
	return dp[l][r]=false;
}
int main()
{
	memset(dp,-1,sizeof(dp));
	cin >> S;
	if(is_cat(0,(int)S.size()))cout << "Cat" << endl;
	else cout << "Rabbit" << endl;
	return 0;
}
```