#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iterator>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>

using namespace std;

#define dump(n) cerr<<"# "<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define iter(c) __typeof__((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();++i)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
typedef pair<int,int> pii;

int solve(int bit,vi& xs,vi& ys,vi& memo)
{
	if(memo[bit]!=-1)
		return memo[bit];
	if(bit==0xffff)
		return memo[bit]=1;
	
	rep(i,4) rep(j,4){
		int p=i*4+j;
		if(bit&1<<p)
			continue;
		int res=0;
		rep(k,4){
			int ii=i+ys[k],jj=j+xs[k],pp=ii*4+jj;
			if(ii<0 || 4<=ii || jj<0 || 4<=jj || (bit&1<<pp))
				continue;
			int next=bit|1<<p|1<<pp;
			res+=solve(next,xs,ys,memo);
		}
		return memo[bit]=res;
	}
	assert(false);
}

int main()
{
	for(;;){
		vi xs(4),ys(4);
		rep(i,4)
			cin>>xs[i]>>ys[i];
		if(xs[0]>4)
			break;
		
		vi memo(1<<16,-1);
		cout<<solve(0,xs,ys,memo)<<endl;
	}
	
	return 0;
}