#include<cstdio>
#include<cstring>

using namespace std;

int n;
char s[512];

int dp[512][512];
int rec(int l,int r){
	if(dp[l][r]!=-1) return dp[l][r];

	if(l==r) return dp[l][r]=1;

	if(s[l]!='m' || s[r-1]!='w') return dp[l][r]=0;

	for(int i=l+1;i<r-1;i++) if(s[i]=='e' && rec(l+1,i) && rec(i+1,r-1)) return dp[l][r]=1;
	return dp[l][r]=0;
}

int main(){
	scanf("%s",s);
	n=strlen(s);
	memset(dp,-1,sizeof dp);
	puts(rec(0,n)?"Cat":"Rabbit");
	return 0;
}
### Prompt

Generate a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include<cstdio>
#include<cstring>

using namespace std;

int n;
char s[512];

int dp[512][512];
int rec(int l,int r){
	if(dp[l][r]!=-1) return dp[l][r];

	if(l==r) return dp[l][r]=1;

	if(s[l]!='m' || s[r-1]!='w') return dp[l][r]=0;

	for(int i=l+1;i<r-1;i++) if(s[i]=='e' && rec(l+1,i) && rec(i+1,r-1)) return dp[l][r]=1;
	return dp[l][r]=0;
}

int main(){
	scanf("%s",s);
	n=strlen(s);
	memset(dp,-1,sizeof dp);
	puts(rec(0,n)?"Cat":"Rabbit");
	return 0;
}
```