#include <iostream>
#include <string>
#include <cctype>
#include <sstream>

using namespace std;

bool check(string str) {
    char last = '1';
    for (auto it: str) {
        if (last == ' ' && it == ' ')
            return false;
        if (!isupper(it) && !isdigit(it) && it != ' ')
            return false;
        last = it;
    }

    stringstream ss;
    ss << str;

    string g1, g2, g3;
    ss >> g1 >> g2 >> g3;

    for (auto it: g1)
        if (isdigit(it))
            return false;

    for (auto it: g2)
        if (isupper(it))
            return false;

    for (auto it: g3)
        if (isdigit(it))
            return false;

    if (g3.size() != 3)
        return false;

    if (g1 == "B") {
        if (g2.size() != 2 && g2.size() != 3)
            return false;
        else
            return true;
    }
    else if (g1.size() != 2)
        return false;

    if (g2.size() != 2)
        return false;
    return true;
}

int main()
{
    int t = 0;
    cin >> t; cin.get();
    while (t --) {
        string str;
        getline(cin, str);

        if (check(str))
            cout << "Correct!" << endl;
        else
            cout << "Incorrect!" << endl;
    }

    return 0;
}