#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
int n, ns;
char s[10000];

inline bool Cifra(char c)
{
    return ('0' <= c && c <= '9');
}

inline bool Litera(char c)
{
    return ('A' <= c && c <= 'Z');
}

inline bool Valid()
{
    ns = strlen(s);
    if(ns < 8 || ns > 9)
        return false;
    if(!Litera(s[0]))
        return false;
    if(s[0] == 'B')
    {
        if(s[1] != ' ')
            return false;
        if(!Cifra(s[2]) || !Cifra(s[3]))
            return false;
        if(s[4] == ' ')
        {
            if(!Litera(s[5]) || !Litera(s[6]) || !Litera(s[7]))
                return false;
            if(ns != 8)
                return false;
            return true;
        }
        else
        {
            if(!Cifra(s[4]))
                return false;
            if(s[5] != ' ')
                return false;
            if(!Litera(s[6]) || !Litera(s[7]) || !Litera(s[8]))
                return false;
            if(ns != 9)
                return false;
            return true;
        }
    }
    else
    {
        if(!Litera(s[1]))
            return false;
        if(s[2] != ' ')
            return false;
        if(!Cifra(s[3]) || !Cifra(s[4]))
            return false;
        if(s[5] != ' ')
            return false;
        if(!Litera(s[6]) || !Litera(s[7]) || !Litera(s[8]))
            return false;
        if(ns != 9)
            return false;
        return true;
    }
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    cin >> n;
    cin.get();
    while(n--)
    {
        cin.getline(s, 10000);
        bool ok = Valid();
        if(ok)
            cout << "Correct!\n";
        else
            cout << "Incorrect!\n";
    }
    return 0;
}