#include <cstdio>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>
#include <bitset>

#define f first
#define s second
#define pb push_back
#define NMAX 100000
#define pii pair <int, int>

using namespace std;

char str[32];

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

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

int main ()
{
  //  freopen ("file.in", "r", stdin);

    int n;
    scanf ("%d\n", &n);

    for (; n; --n)
    {
        gets (str);

        int m = strlen (str);

        if (m < 8 || m > 9)
        {
            printf ("Incorrect!\n");
            continue;
        }

        if (str[0] == 'B' && str[1] == ' ')
        {
            if (digit (str[2]) && digit (str[3]))
            {
                if (digit (str[4]))
                {
                    if (str[5] == ' ' && let (str[6]) && let (str[7]) && let (str[8]) && m == 9)
                    {
                        printf ("Correct!\n");
                        continue;
                    }

                    else
                    {
                        printf ("Incorrect!\n");
                        continue;
                    }
                }

                else
                {
                    if (str[4] == ' ' && let (str[5]) && let (str[6]) && let (str[7]) && m == 8)
                    {
                        printf ("Correct!\n");
                        continue;
                    }

                    else
                    {
                        printf ("Incorrect!\n");
                        continue;
                    }
                }
            }

            else
            {
                printf ("Incorrect!\n");
                continue;
            }
        }

        else if (let (str[0]) && let (str[1]) && str[2] == ' ' && digit (str[3]) && digit (str[4]) && str[5] == ' ' && let (str[6]) && let (str[7]) && let(str[8]) && m == 9)
        {
            printf ("Correct!\n");
            continue;
        }

        else
        {
            printf ("Incorrect!\n");
            continue;
        }
    }

    return 0;
}