#include "bits/stdc++.h"

using namespace std;

static void solve()
{
  string str;
  cin >> str;
  int m = 0, e = 0;
  bool cat = true;
  for(int i = 0; i < str.size(); i++) {
    if (!m && (i || str[i] != 'm') || !cat) {
      cat = false;
      break;
    }
    switch (str[i]) {
    case 'm':
      m++;
      break;
    case 'e':
      e++;
      if (m < e) cat = false;
      break;
    case 'w':
      m--;
      e--;
      if (m < 0 || e < 0) cat = false;
    }
  }
  if (m || e) cat = false;
  if (cat) cout << "Cat\n";
  else cout << "Rabbit\n";
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie();
  solve();
}
### Prompt

Your task is to create a CPP solution to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

```cpp
#include "bits/stdc++.h"

using namespace std;

static void solve()
{
  string str;
  cin >> str;
  int m = 0, e = 0;
  bool cat = true;
  for(int i = 0; i < str.size(); i++) {
    if (!m && (i || str[i] != 'm') || !cat) {
      cat = false;
      break;
    }
    switch (str[i]) {
    case 'm':
      m++;
      break;
    case 'e':
      e++;
      if (m < e) cat = false;
      break;
    case 'w':
      m--;
      e--;
      if (m < 0 || e < 0) cat = false;
    }
  }
  if (m || e) cat = false;
  if (cat) cout << "Cat\n";
  else cout << "Rabbit\n";
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie();
  solve();
}
```