#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

string s;
int memo[505][505];

bool dfs(int l, int r) {
	if(l > r) return true;
	if(memo[l][r] != -1) return memo[l][r];

	if(s[l] == 'm' && s[r] == 'w') {
		REP(i, l+1, r) {
			if(s[i] == 'e') {
				if(dfs(l+1, i-1) && dfs(i+1, r-1)) {
					return memo[l][r] = true;
				}
			}
		}
	}
	return memo[l][r] = false;
}

int main() {
	cin >> s;
	memset(memo, -1, sizeof(memo));

	if(dfs(0, s.size()-1)) {
		cout << "Cat" << endl;
	} else {
		cout << "Rabbit" << endl;
	}

	return 0;
}
### Prompt

Please create a solution in CPP to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

string s;
int memo[505][505];

bool dfs(int l, int r) {
	if(l > r) return true;
	if(memo[l][r] != -1) return memo[l][r];

	if(s[l] == 'm' && s[r] == 'w') {
		REP(i, l+1, r) {
			if(s[i] == 'e') {
				if(dfs(l+1, i-1) && dfs(i+1, r-1)) {
					return memo[l][r] = true;
				}
			}
		}
	}
	return memo[l][r] = false;
}

int main() {
	cin >> s;
	memset(memo, -1, sizeof(memo));

	if(dfs(0, s.size()-1)) {
		cout << "Cat" << endl;
	} else {
		cout << "Rabbit" << endl;
	}

	return 0;
}
```