#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;

bool isCat(string &s) {
    int depth = 0;
    vector<int> stack(s.size(), 0);
    REP (i, 0, s.size()) {
        if (s[i] == 'm') {
            stack[depth++] = 1;
        } else if (s[i] == 'e') {
            if (depth <= 0 || stack[depth - 1] != 1) return false;
            stack[depth - 1] = 2;
        } else if (s[i] == 'w') {
            if (depth <= 0 || stack[depth - 1] != 2) return false;
            stack[depth - 1] = 0;
            depth--;
        } else {
            return false;
        }
        if (depth <= 0) return i == s.size() - 1;
    }
    return depth == 0;
}

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

Please create a solution in Cpp to the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;

bool isCat(string &s) {
    int depth = 0;
    vector<int> stack(s.size(), 0);
    REP (i, 0, s.size()) {
        if (s[i] == 'm') {
            stack[depth++] = 1;
        } else if (s[i] == 'e') {
            if (depth <= 0 || stack[depth - 1] != 1) return false;
            stack[depth - 1] = 2;
        } else if (s[i] == 'w') {
            if (depth <= 0 || stack[depth - 1] != 2) return false;
            stack[depth - 1] = 0;
            depth--;
        } else {
            return false;
        }
        if (depth <= 0) return i == s.size() - 1;
    }
    return depth == 0;
}

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