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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

string s;
int dp[505][505];

bool dfs(int l, int r) {
	//cout << "DFS " << l << " " << r << " " << s.substr(l, r - l) << endl;
	if (dp[l][r] != -1) return (bool)dp[l][r];
	if (l == r) return true;

	dp[l][r] = 0;

	if (s[l] == 'm' && s[r - 1] == 'w') {
		for (int i = l + 1; i < r - 1; i++) {
			if (s[i] == 'e') {
				dp[l][r] |= dfs(l + 1, i) && dfs(i + 1, r - 1);
			}
		}
	}

	return dp[l][r];
}

int main() {
	rep(i, 0, 505) rep(j, 0, 505) dp[i][j] = -1;

	cin >> s;
	cout << (dfs(0, (int)s.length()) ? "Cat" : "Rabbit") << endl;
}


### Prompt

Please provide a Cpp coded solution to the problem described below:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

string s;
int dp[505][505];

bool dfs(int l, int r) {
	//cout << "DFS " << l << " " << r << " " << s.substr(l, r - l) << endl;
	if (dp[l][r] != -1) return (bool)dp[l][r];
	if (l == r) return true;

	dp[l][r] = 0;

	if (s[l] == 'm' && s[r - 1] == 'w') {
		for (int i = l + 1; i < r - 1; i++) {
			if (s[i] == 'e') {
				dp[l][r] |= dfs(l + 1, i) && dfs(i + 1, r - 1);
			}
		}
	}

	return dp[l][r];
}

int main() {
	rep(i, 0, 505) rep(j, 0, 505) dp[i][j] = -1;

	cin >> s;
	cout << (dfs(0, (int)s.length()) ? "Cat" : "Rabbit") << endl;
}


```