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

int mm[500][500];

int is_cat(string &cry, int l, int r) {
    if (l == r) return 1;
    if ((r - l) % 3 || cry[l] != 'm' || cry[r-1] != 'w') return 0;
    if (~mm[l][r]) return mm[l][r];
    for (int i=l+1; i<r-1; ++i) {
        if (cry[i] == 'e' && is_cat(cry, l+1, i) && is_cat(cry, i+1, r-1)) {
            return mm[l][r] = 1;
        }
    }
    return mm[l][r] = 0;
}

int main() {
    string S;
    cin >> S;
    for (int i=0; i<500; ++i) {
        for (int j=0; j<500; ++j) {
            mm[i][j] = -1;
        }
    }
    cout << (is_cat(S, 0, (int)S.size()) ? "Cat" : "Rabbit") << endl;
    return 0;
}

### Prompt

In CPP, your task is to solve the following problem:

Example

Input

mmemewwemeww


Output

Cat

### Response

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

int mm[500][500];

int is_cat(string &cry, int l, int r) {
    if (l == r) return 1;
    if ((r - l) % 3 || cry[l] != 'm' || cry[r-1] != 'w') return 0;
    if (~mm[l][r]) return mm[l][r];
    for (int i=l+1; i<r-1; ++i) {
        if (cry[i] == 'e' && is_cat(cry, l+1, i) && is_cat(cry, i+1, r-1)) {
            return mm[l][r] = 1;
        }
    }
    return mm[l][r] = 0;
}

int main() {
    string S;
    cin >> S;
    for (int i=0; i<500; ++i) {
        for (int j=0; j<500; ++j) {
            mm[i][j] = -1;
        }
    }
    cout << (is_cat(S, 0, (int)S.size()) ? "Cat" : "Rabbit") << endl;
    return 0;
}

```