#include <iostream>
#include <string>
#include <stack>
using namespace std;

int cat(string str) {
  stack <int> stk;
  for(int i=0;i<str.size();i++) {
    if(str[i] == 'm') stk.push(0);
    else if(str[i] == 'e') stk.push(1);
    else if(str[i] == 'w') {
      if(stk.empty()) return false;
      if(stk.top() == 1)  stk.pop();
      else return false;
      if(stk.top() == 0) stk.pop();
      else return false;
      if(stk.empty() && i != str.size()-1) return false;
    }
  }
  if(stk.empty()) return true;
  return false;
}
int main() {
  string str;
  cin >> str;
  if(cat(str) == true) cout << "Cat"<<endl;
  else cout << "Rabbit"<<endl;
 
  return 0;
}
### Prompt

Construct a cpp code solution to the problem outlined:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <iostream>
#include <string>
#include <stack>
using namespace std;

int cat(string str) {
  stack <int> stk;
  for(int i=0;i<str.size();i++) {
    if(str[i] == 'm') stk.push(0);
    else if(str[i] == 'e') stk.push(1);
    else if(str[i] == 'w') {
      if(stk.empty()) return false;
      if(stk.top() == 1)  stk.pop();
      else return false;
      if(stk.top() == 0) stk.pop();
      else return false;
      if(stk.empty() && i != str.size()-1) return false;
    }
  }
  if(stk.empty()) return true;
  return false;
}
int main() {
  string str;
  cin >> str;
  if(cat(str) == true) cout << "Cat"<<endl;
  else cout << "Rabbit"<<endl;
 
  return 0;
}
```