#include<iostream>
#include<string>
using namespace std;
string s;
bool iscat(int l, int r) {
	if (l > r) return true;
	if (s[l] != 'm' || s[r] != 'w') return false;
	int rec = 0;
	for (int i = l + 1; i < r; i++) {
		if (rec == 0 && s[i] == 'e') return iscat(l + 1, i - 1) && iscat(i + 1, r - 1);
		else if (s[i] == 'm') rec++;
		else if (s[i] == 'w') rec--;
		if (rec < 0) return false;
	}
}
int main() {
	cin >> s;
	cout << (iscat(0, s.size() - 1) ? "Cat" : "Rabbit") << endl;
}


### Prompt

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

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include<iostream>
#include<string>
using namespace std;
string s;
bool iscat(int l, int r) {
	if (l > r) return true;
	if (s[l] != 'm' || s[r] != 'w') return false;
	int rec = 0;
	for (int i = l + 1; i < r; i++) {
		if (rec == 0 && s[i] == 'e') return iscat(l + 1, i - 1) && iscat(i + 1, r - 1);
		else if (s[i] == 'm') rec++;
		else if (s[i] == 'w') rec--;
		if (rec < 0) return false;
	}
}
int main() {
	cin >> s;
	cout << (iscat(0, s.size() - 1) ? "Cat" : "Rabbit") << endl;
}


```