#include <bits/stdc++.h>
using namespace std;

void prians(bool answer) {
  if(answer)
    cout << "Cat" << endl;
  else
    cout << "Rabbit" << endl;
}
bool solve(string s);
string t;

int main() {
  cin >> t;
  prians(solve(t));
  return 0;
}

bool solve(string s) {
  if(s.size() == 0) return 1;
  string nexts[2];
  int cnt[3] = {0};
  int i;
  if(s[0] != 'm' || s[s.size() - 1] != 'w') return 0;
  // left side
  for(i = 1; i < s.size() - 1; ++i) {
    if(s[i] == 'm')
      ++cnt[0];
    else if(s[i] == 'e')
      ++cnt[1];
    else if(s[i] == 'w')
      ++cnt[2];
    else
      return 0;
    if(cnt[0] == cnt[2] && cnt[0] + 1 == cnt[1]) break;
    nexts[0] += s[i];
  }
  // right side
  cnt[0] = cnt[1] = cnt[2] = 0;
  while(++i < s.size() - 1) {
    if(s[i] == 'm')
      ++cnt[0];
    else if(s[i] == 'e')
      ++cnt[1];
    else if(s[i] == 'w')
      ++cnt[2];
    else
      return 0;
    nexts[1] += s[i];
  }
  if(cnt[0] == cnt[1] && cnt[1] == cnt[2])
    return solve(nexts[0]) & solve(nexts[1]);
  else
    return 0;
}


### Prompt

Please formulate a Cpp solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;

void prians(bool answer) {
  if(answer)
    cout << "Cat" << endl;
  else
    cout << "Rabbit" << endl;
}
bool solve(string s);
string t;

int main() {
  cin >> t;
  prians(solve(t));
  return 0;
}

bool solve(string s) {
  if(s.size() == 0) return 1;
  string nexts[2];
  int cnt[3] = {0};
  int i;
  if(s[0] != 'm' || s[s.size() - 1] != 'w') return 0;
  // left side
  for(i = 1; i < s.size() - 1; ++i) {
    if(s[i] == 'm')
      ++cnt[0];
    else if(s[i] == 'e')
      ++cnt[1];
    else if(s[i] == 'w')
      ++cnt[2];
    else
      return 0;
    if(cnt[0] == cnt[2] && cnt[0] + 1 == cnt[1]) break;
    nexts[0] += s[i];
  }
  // right side
  cnt[0] = cnt[1] = cnt[2] = 0;
  while(++i < s.size() - 1) {
    if(s[i] == 'm')
      ++cnt[0];
    else if(s[i] == 'e')
      ++cnt[1];
    else if(s[i] == 'w')
      ++cnt[2];
    else
      return 0;
    nexts[1] += s[i];
  }
  if(cnt[0] == cnt[1] && cnt[1] == cnt[2])
    return solve(nexts[0]) & solve(nexts[1]);
  else
    return 0;
}


```