#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

bool dfs(string s){
  int res = 0;
  if(!s.size()) return 1;
  if(s[0] != 'm' || s[s.size()-1] != 'w') return 0;
  for(int i = 0; i < s.size(); i++){
    if(s[i] != 'e') continue;
    string a = s.substr(1, i-1);
    string b = s.substr(i+1); b.erase(b.end()-1);
    if(dfs(a) && dfs(b)) return 1;
  }
  return 0;
}

int main(){
  string s;
  cin >> s;

  while(1){
    if(s.empty()){
      puts("Cat");
      break;
    }

    string::size_type p = s.find("mew");
    if(p == string::npos){
      puts("Rabbit");
      break;
    }else{
      if(!(s.size() == 3 || (s[p-1] == 'm' && s[p+3] == 'e') || (s[p-1] == 'e' && s[p+3] == 'w'))){
      puts("Rabbit");
      break;
      }
      s.erase(p, 3);
    }
  }
  return 0;
}
### Prompt

Generate a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

using namespace std;

bool dfs(string s){
  int res = 0;
  if(!s.size()) return 1;
  if(s[0] != 'm' || s[s.size()-1] != 'w') return 0;
  for(int i = 0; i < s.size(); i++){
    if(s[i] != 'e') continue;
    string a = s.substr(1, i-1);
    string b = s.substr(i+1); b.erase(b.end()-1);
    if(dfs(a) && dfs(b)) return 1;
  }
  return 0;
}

int main(){
  string s;
  cin >> s;

  while(1){
    if(s.empty()){
      puts("Cat");
      break;
    }

    string::size_type p = s.find("mew");
    if(p == string::npos){
      puts("Rabbit");
      break;
    }else{
      if(!(s.size() == 3 || (s[p-1] == 'm' && s[p+3] == 'e') || (s[p-1] == 'e' && s[p+3] == 'w'))){
      puts("Rabbit");
      break;
      }
      s.erase(p, 3);
    }
  }
  return 0;
}
```