#include <iostream>
#include <string.h>

using namespace std;

int main(int argc, char *argv)
{
	int n;
	char a[5], b[5], c[5];
	cin >> n;
	bool ok;
	for (int i = 1; i <= n; ++i)
	{
		ok = true;
		cin >> a;
		cin >> b;
		cin >> c;
		if (a[0] == 'B' && strlen(a) == 1)
		{
			if (strlen(b) != 3 && strlen(b) != 2)
			{
				ok = false;
			}
			else
			{
				for (int j = 0; j < strlen(b); ++j)
				{
					if (b[j] <'0' && b[j] > '9')
					{
						ok = false;
					}
				}
			}	
		}
		else if(a[0] >= 'A' && a[0] <= 'Z' && a[1] >= 'A' && a[1] <= 'Z' && strlen(a) == 2)
		{
			if (strlen(b) != 2)
			{
				ok = false;
			}
			else
			{
				for (int j = 0; j <= 1; ++j)
				{
					if (b[j] <'0' && b[j] > '9')
					{
						ok = false;
					}
				}
			}
		}
		else
		{
			ok = false;
		}
		if (strlen(c) != 3)
		{
			ok = false;
		}
		else
		{
			for (int j = 0; j <= 2; ++j)
			{
				if (c[j] < 'A' && c[j] > 'Z')
				{
					ok = false;
				}
			}
		}
		if (ok)
		{
			cout << "Correct!\n";
		}
		else cout << "Incorrect!\n";
	}
	return 0;
}