#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>

using namespace std;
using ll = long long;

bool solve(string s){
  if(s == "mew" || s == "") return true;
  if(s[0] != 'm' || s[s.length()-1] != 'w') return false;
  vector<int> cnt(3, 0);
  for(int i = 1; i < s.length()-1; i++){
    if(s[i] == 'm') cnt[0]++;
    else if(s[i] == 'w') cnt[2]++;
    if(s[i] == 'e' && cnt[0] == cnt[1] && cnt[0] == cnt[2]){
      string a = s.substr(1, i-1), b = s.substr(i+1, s.length()-2-i);
      if(solve(a) && solve(b)) return true;
    }
    if(s[i] == 'e') cnt[1]++;
  }
  return false;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  string s; cin >> s;
  if(solve(s)) cout << "Cat" << endl;
  else cout << "Rabbit" << endl;
  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


### Prompt

Develop a solution in CPP to the problem described below:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>

using namespace std;
using ll = long long;

bool solve(string s){
  if(s == "mew" || s == "") return true;
  if(s[0] != 'm' || s[s.length()-1] != 'w') return false;
  vector<int> cnt(3, 0);
  for(int i = 1; i < s.length()-1; i++){
    if(s[i] == 'm') cnt[0]++;
    else if(s[i] == 'w') cnt[2]++;
    if(s[i] == 'e' && cnt[0] == cnt[1] && cnt[0] == cnt[2]){
      string a = s.substr(1, i-1), b = s.substr(i+1, s.length()-2-i);
      if(solve(a) && solve(b)) return true;
    }
    if(s[i] == 'e') cnt[1]++;
  }
  return false;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  string s; cin >> s;
  if(solve(s)) cout << "Cat" << endl;
  else cout << "Rabbit" << endl;
  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


```