#include "testlib.h"

/**
 * Author: Niyaz Nigmatullin
 */

int const MAX_TOTAL_CELLS = 2500;
int const MAX_SIDE = 50;
int const MAX_TESTS = 625;
int const MAX_COLORS = (1 << 24);

using namespace std;

struct test {
	int size;
	vector<vector<int>> field;
};

void printTest(test const &e) {
	cout << e.size << '\n';
	for (int r = 0; r < e.size; r++) {
		for (int c = 0; c < e.size; c++) {
			if (c > 0) cout << ' ';
			cout << e.field[r][c];
		}
		cout << '\n';
	}
}

void printTests(vector<test> const &tests) {
	cout << tests.size() << '\n';
	for (test const &e : tests) {
		printTest(e);
	}
}


// B L K F R T

// L R U D
vector<vector<int>> const ROTATE_CUBE = {
	{1, 5, 2, 3, 0, 4},
	{4, 0, 2, 3, 5, 1},
	{2, 1, 5, 0, 4, 3},
	{3, 1, 0, 5, 4, 2},
};

vector<int> const DIRS_RIGHT_DOWN = {1, 3};

vector<int> const DR = {0, 0, -1, 1};
vector<int> const DC = {-1, 1, 0, 0};


vector<int> rotate(vector<int> const &cube, int dir) {
	vector<int> res(6);
	for (int i = 0; i < 6; i++) {
		res[i] = cube[ROTATE_CUBE[dir][i]];
	}
	return res;
}
