#include <stdio.h>
#include <inttypes.h>
#include <string.h>

int x[4], y[4];

uint64_t memo[1 << 16];

uint64_t search(int current) {
	int i, j, k;
	if (current == (1 << 16) - 1) return 1;
	if (memo[current]) return ~memo[current];
	for (i = 0; i < 4; i++) {
		for (j = 0; j < 4; j++) {
			if (!((current >> (i * 4 + j)) & 1)) {
				uint64_t ret = 0;
				int next = current | (1 << (i * 4 + j));
				for (k = 0; k < 8; k++) {
					int ni, nj;
					if (k % 2 == 0) {
						ni = i + y[k / 2];
						nj = j + x[k / 2];
					} else {
						ni = i - y[k / 2];
						nj = j - x[k / 2];
					}
					if (0 <= ni && ni < 4 && 0 <= nj && nj < 4 && !((current >> (ni * 4 + nj)) & 1)) {
						ret += search(next | (1 << (ni * 4 + nj)));
					}
				}
				return ~(memo[current] = ~ret);
			}
		}
	}
	return 0; /* will not come here */
}

int main(void) {
	while (scanf("%d", &x[0]) == 1 && x[0] <= 4) {
		int i;
		if (scanf("%d", &y[0]) != 1) return 1;
		for (i = 1; i < 4; i++) {
			if (scanf("%d%d", &x[i], &y[i]) != 2) return 1;
		}
		memset(memo, 0, sizeof(memo));
		printf("%"PRIu64"\n", search(0));
	}
	return 0;
}