#include <stdio.h>
#include <conio.h>

int main(void)
{
	int n, O, A, B, AB, i, kol[1000], prim[4][1000] = {0};
	char str[n][2];
	
	scanf("%d", &n);
	scanf("%d %d %d %d", &O, &A, &B, &AB);
	for (i = 0; i < n; i++)
		scanf("%s %d", &str[i][0], &kol[i]);	

	printf("nemoguce");
		
	return 0;
}