#include <iostream>
#include <string>

bool check(char*& c, char ec = '\0') {
	if(*c == ec) return true;
	int cstep = 0;
	while(*c) {
		if(cstep == 0 && *c == 'm'){
			cstep++;
			if(!check(++c, 'e')) return false;
		}
		else if(cstep == 1 && *c == 'e'){
			cstep++;
			if(!check(++c, 'w')) return false;
		}
		else if(cstep == 2 && *c == 'w'){
			return (*++c == ec);
		}
		else {
			return false;
		}
	}
	return false;
}

int main(void) {

	char str[512];
	std::cin >> str;

	char *c = str;
	if(check(c)) {
		std::cout << "Cat\n";
	}else{
		std::cout << "Rabbit\n";
	}

	return 0;
}
### Prompt

Please formulate a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <string>

bool check(char*& c, char ec = '\0') {
	if(*c == ec) return true;
	int cstep = 0;
	while(*c) {
		if(cstep == 0 && *c == 'm'){
			cstep++;
			if(!check(++c, 'e')) return false;
		}
		else if(cstep == 1 && *c == 'e'){
			cstep++;
			if(!check(++c, 'w')) return false;
		}
		else if(cstep == 2 && *c == 'w'){
			return (*++c == ec);
		}
		else {
			return false;
		}
	}
	return false;
}

int main(void) {

	char str[512];
	std::cin >> str;

	char *c = str;
	if(check(c)) {
		std::cout << "Cat\n";
	}else{
		std::cout << "Rabbit\n";
	}

	return 0;
}
```