#include <iostream>
#include <stack>
#include <string>

using namespace std;

bool catChecker(string str){

	stack<char> cnt;

	for(int i=0;i<str.size();i++){
		char c=str.at(i);
		
		if(c=='m'){
			cnt.push(c);
		}else if(!cnt.empty()){
			if(c=='e' && cnt.top()=='m'){
				cnt.pop();
				cnt.push(c);
			}else if(c=='w' && cnt.top()=='e'){
				cnt.pop();
			}else{
				return false;
			}
		}else{
			return false;
		}
		
		if(i<str.size()-1 && cnt.empty()){
			return false;
		}
	}

	if(!cnt.empty()){
		return false;
	}
	
	return true;
}

int main(void){

	string str;

	while(cin>>str)
		if(catChecker(str)) cout << "Cat" << endl;
		else cout << "Rabbit" << endl;

	return 0;
}
### Prompt

Develop a solution in Cpp to the problem described below:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

using namespace std;

bool catChecker(string str){

	stack<char> cnt;

	for(int i=0;i<str.size();i++){
		char c=str.at(i);
		
		if(c=='m'){
			cnt.push(c);
		}else if(!cnt.empty()){
			if(c=='e' && cnt.top()=='m'){
				cnt.pop();
				cnt.push(c);
			}else if(c=='w' && cnt.top()=='e'){
				cnt.pop();
			}else{
				return false;
			}
		}else{
			return false;
		}
		
		if(i<str.size()-1 && cnt.empty()){
			return false;
		}
	}

	if(!cnt.empty()){
		return false;
	}
	
	return true;
}

int main(void){

	string str;

	while(cin>>str)
		if(catChecker(str)) cout << "Cat" << endl;
		else cout << "Rabbit" << endl;

	return 0;
}
```