#include <iostream>
#include <string>
using namespace std;
typedef long long ll;

bool solve(string s) {
	int n = s.size();
	int h = 0;
	if (s[0] != 'm') return false;
	for (int i = 0; i < n-1; ++i) {
		if (s[i] == 'm') {
			if (s[i+1] == 'm') h++;
			else if (s[i+1] == 'w') h -= 10000;
		} else if (s[i] == 'e') {
			if (s[i+1] == 'm') h++;
			else if (s[i+1] == 'e') h -= 10000;
		} else {
			if (s[i+1] == 'm') h -= 10000;
			else h--;
		}
		if (h < 0) return false;
	}
	return h == 0;
}

int main() {
	string s; cin >> s;
	cout << (solve(s) ? "Cat" : "Rabbit") << endl;
}

### Prompt

Please formulate a Cpp solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;

bool solve(string s) {
	int n = s.size();
	int h = 0;
	if (s[0] != 'm') return false;
	for (int i = 0; i < n-1; ++i) {
		if (s[i] == 'm') {
			if (s[i+1] == 'm') h++;
			else if (s[i+1] == 'w') h -= 10000;
		} else if (s[i] == 'e') {
			if (s[i+1] == 'm') h++;
			else if (s[i+1] == 'e') h -= 10000;
		} else {
			if (s[i+1] == 'm') h -= 10000;
			else h--;
		}
		if (h < 0) return false;
	}
	return h == 0;
}

int main() {
	string s; cin >> s;
	cout << (solve(s) ? "Cat" : "Rabbit") << endl;
}

```