#include <bits/stdc++.h>
#include <cctype>

using namespace std;

inline bool ammic(string x) {
    for (int i = 0; i < x.size(); ++i) {
        if (islower(x[i]))
            return 1;
    }
    return 0;
}

inline bool amcifra(string x) {
    for (int i = 0; i < x.size(); ++i) {
        if (isdigit(x[i]))
            return 1;
    }
    return 0;
}

inline bool amlitera(string x) {
    for (int i = 0; i < x.size(); ++i) {
        if (isalpha(x[i]))
            return 1;
    }
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    string a, b, c;
    cin >> n;
    for (; n; --n) {
        cin >> a >> b >> c;
        if (ammic(a) || ammic(b) || ammic(c)) {
            cout << "Incorrect!\n";
            continue;
        }
        if (amcifra(a) || amlitera(b) || amcifra(c)) {
            cout << "Incorrect!\n";
            continue;
        }
        if ((b.size() == 3 && a != "B") || b.size() < 2 || b.size() > 3) {
            cout << "Incorrect!\n";
            continue;
        }
        if (b.size() < 2 || a.size() > 2 || c.size() > 3) {
            cout << "Incorrect!\n";
            continue;
        }
        if ((a.size() == 1 && a != "B") || c.size() != 3) {
            cout << "Incorrect!\n";
            continue;
        }
        cout << "Correct!\n";
    }
    return 0;
}