#include <iostream>
#include "windows.h"
using namespace std;

int main ()
{

	int x = 0, y = 0, color;

	for(; x < 16; x++)
	{
		y = 0;
		for(; y < 16; y++)
		{
			color = 16*y + x;
			cout.width(4);
			SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
			cout << color << " ";
		}
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
	}

	return 0; 
}