#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

map<string, bool>mp;
bool check(string s) {
	if (s.empty())return true;
	if (*s.begin() != 'm' || *s.rbegin() != 'w')return false;
	if (mp.find(s) != mp.end())return mp[s];
	for (int i = 1; i < s.size() - 1; i++) {
		if (s[i] != 'e')continue;
		if (check(s.substr(1, i - 1)) && check(s.substr(i + 1, s.size() - i - 2)))return mp[s] = true;
	}
	return mp[s] = false;
}
int main() {
	string s; cin >> s;
	puts(check(s) ? "Cat" : "Rabbit");
}
### Prompt

Create a solution in Cpp for the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

map<string, bool>mp;
bool check(string s) {
	if (s.empty())return true;
	if (*s.begin() != 'm' || *s.rbegin() != 'w')return false;
	if (mp.find(s) != mp.end())return mp[s];
	for (int i = 1; i < s.size() - 1; i++) {
		if (s[i] != 'e')continue;
		if (check(s.substr(1, i - 1)) && check(s.substr(i + 1, s.size() - i - 2)))return mp[s] = true;
	}
	return mp[s] = false;
}
int main() {
	string s; cin >> s;
	puts(check(s) ? "Cat" : "Rabbit");
}
```