#include <string>
#include <iostream>

using namespace std;

bool Cat(string str, int p){
  if(str.size() == 0) return true;
  if(str[0] == 'm' && str[(int)str.size()-1] == 'w'){
    int m = 0, w = 0;
    for(int i=1;i<str.size()-1;i++){
      if(str[i] == 'm') m++;
      if(str[i] == 'w') w++;
      if(str[i] == 'e' && m == w && Cat(str.substr(1, i-1), p+1) && Cat(str.substr(i+1, (int)str.size()-i-2), p+1)) return true;
    }
  }
  return false;
}

int main(){
  string str;
  cin >> str;
  cout << (Cat(str, 0) ? "Cat" : "Rabbit") << endl;
}
### Prompt

Your challenge is to write a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

using namespace std;

bool Cat(string str, int p){
  if(str.size() == 0) return true;
  if(str[0] == 'm' && str[(int)str.size()-1] == 'w'){
    int m = 0, w = 0;
    for(int i=1;i<str.size()-1;i++){
      if(str[i] == 'm') m++;
      if(str[i] == 'w') w++;
      if(str[i] == 'e' && m == w && Cat(str.substr(1, i-1), p+1) && Cat(str.substr(i+1, (int)str.size()-i-2), p+1)) return true;
    }
  }
  return false;
}

int main(){
  string str;
  cin >> str;
  cout << (Cat(str, 0) ? "Cat" : "Rabbit") << endl;
}
```