#include <iostream>
using namespace std;

bool test() {
	int c[2][4] = {}, d[2][7] = {};
	for (int i = 0; i < 4; ++i) {
		for (int j = 0; j < 4; ++j) {
			char x;
			cin >> x;
			if (x != 'x') continue;
			++c[0][i], ++c[1][j];
			++d[0][i + j], ++d[1][i + (3 - j)];
		}
	}
	for (int i = 0; i < 4; ++i)
		if (c[0][i] > 1 || c[1][i] > 1)
			return true;
	for (int i = 0; i < 7; ++i)
		if (d[0][i] > 1 || d[1][i] > 1)
			return true;
	return false;
}

int main() {
	int N;
	cin >> N;
	cout << boolalpha;
	for (int i = 0; i < N; ++i)
		cout << "Test #" << i + 1 << ": " << test() << endl;
}