#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int N;
string s;

int dp[510][510];

int f(int l, int r) {
	if(dp[l][r] != -1) return dp[l][r];
	if(l == r) return 1;
	if(l > r) return 0;
	if(s[l] != 'm' || s[r - 1] != 'w') return 0;
	dp[l][r] = 0;
	for(int i = l + 1; i < r; i++) {
		if(s[i] == 'e') {
			int res1 = f(l + 1, i);
			int res2 = f(i + 1, r - 1);
			if(res1 && res2) {
				dp[l][r] = 1;
				break;
			}
		}
	}
	return dp[l][r];
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	memset(dp, -1, sizeof dp);
	cin >> s;
	N = s.size();

	if(f(0, N) == 1) {
		cout << "Cat" << endl;
	}
	else {
		cout << "Rabbit" << endl;
	}

}
### Prompt

Construct a cpp code solution to the problem outlined:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int N;
string s;

int dp[510][510];

int f(int l, int r) {
	if(dp[l][r] != -1) return dp[l][r];
	if(l == r) return 1;
	if(l > r) return 0;
	if(s[l] != 'm' || s[r - 1] != 'w') return 0;
	dp[l][r] = 0;
	for(int i = l + 1; i < r; i++) {
		if(s[i] == 'e') {
			int res1 = f(l + 1, i);
			int res2 = f(i + 1, r - 1);
			if(res1 && res2) {
				dp[l][r] = 1;
				break;
			}
		}
	}
	return dp[l][r];
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	memset(dp, -1, sizeof dp);
	cin >> s;
	N = s.size();

	if(f(0, N) == 1) {
		cout << "Cat" << endl;
	}
	else {
		cout << "Rabbit" << endl;
	}

}
```