# include 
# include 
int problem(int w, char n[])
{
	int a[2][4]={'\0'}, i, j, k, o[8][3]={'\0'}, counto=0;
	for(i=0;i<2;i++)
	{
		j = 0;
		if((n[i]>='0')&&(n[i]<='9'))
			j = (n[i]-'0');
		else
			j = (n[i]-'A'+10);
		for(k=0;k<4;k++)
		{
			a[i][3-k] = j%2;
			j = j/2;
		}
	}
	for(i=0;i<3;i++)
	{
		if((a[0][i]==a[0][i+1])&&(a[0][i]==a[1][i])&&(a[0][i]==a[1][i+1])&&(a[0][i]==1))
		{
			o[counto][1] = 5;
			switch(i)
			{
				case 0:
					o[counto][0] = 0;
					o[counto][2] = 5;
					break;
				case 1:
					o[counto][0] = 5;
					o[counto][2] = 0;
					break;
				case 2:
					o[counto][0] = 1;
					o[counto][2] = 5;
					break;
			}
			counto++;
			a[0][i] = 0;
			a[0][i+1] = 0;
			a[1][i] = 0;
			a[1][i+1] = 0;
		}
	}	
	for(i=0;i<2;i++)
	{
		if((a[i][0]==a[i][1])&&(a[i][2]==a[1][3])&&(a[i][1]==a[i][2])&&(a[3][i]==1))
		{
			o[counto][0] = 5;
			o[counto][1] = i;
			o[counto][2] = 5;
			counto++;
			a[i][0] = 0;
			a[i][1] = 0;
			a[i][2] = 0;
			a[i][3] = 0;
		}
	}
	if((a[0][0]==a[0][3])&&(a[0][0]==a[1][0])&&(a[0][0]==a[1][3])&&(a[0][0]==1))
	{
		o[counto][0] = 5;
		o[counto][1] = 5;
		o[counto][2] = 1;
		counto++;
		a[0][0] = 0;
		a[0][3] = 0;
		a[1][3] = 0;
		a[1][0] = 0;
	}
	for(i=0;i<2;i++)
	{
		for(j=0;j<3;j++)
		{
			if((a[i][j]==a[i][j+1])&&(a[i][j]==1))
			{
				o[counto][1] = i;
				switch(j)
				{
					case 0:
						o[counto][0] = 0;
						o[counto][2] = 5;
						break;
					case 1:
						o[counto][0] = 5;
						o[counto][2] = 0;
						break;
					case 2:
						o[counto][0] = 1;
						o[counto][2] = 5;
						break;
				}
				counto++;
				a[i][j] = 0;
				a[i][j+1] = 0;
			}
		}
	}
	for(i=0;i<4;i++)
	{
		if((a[0][i]==a[1][i])&&(a[0][i]==1))
		{
			o[counto][1] = 5;
			switch(i)
			{
				case 0:
					o[counto][0] = 0;
					o[counto][2] = 1;
					break;
				case 1:
					o[counto][0] = 0;
					o[counto][2] = 0;
					break;
				case 2:
					o[counto][0] = 1;
					o[counto][2] = 0;
					break;
				case 3:
					o[counto][0] = 1;
					o[counto][2] = 1;
					break;
			}
			counto++;
			a[0][i] = 0;
			a[1][i] = 0;
		}
	}
	for(i=0;i<2;i++)
	{
		if((a[i][0]==a[i][3])&&(a[i][0]==1))
		{
			o[counto][0] = 5;
			o[counto][1] = i;
			o[counto][2] = 1;
			counto++;
			a[i][0] = 0;
			a[i][3] = 0;
		}
	}
	for(i=0;i<2;i++)
	{
		for(j=0;j<4;j++)
		{
			if(a[i][j]==1)
			{
				o[counto][0] = j/2;
				o[counto][1] = i;
				if((j==0)||(j==3))
					o[counto][2] = 1;
				else
					o[counto][2] = 0;
				counto++;
			}
		}
	}
	printf("%d. ", w);
	for(i=0;i