#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<cmath>
#include<cstring>
using namespace std;
int a[4],b[4],c[4][4]={};
int fn(int p,int q){
  int i;
  int ct=0;
  if(0){
  }else if(q==4){
    ct=1;
  }else if(c[q][p]){
    ct+=fn(p==3?0:p+1,p==3?q+1:q);
  }else{
    c[q][p]=-1;
    for(i=0;i<4;i++){
      if(0<=p+a[i]&&p+a[i]<4&&0<=q+b[i]&&q+b[i]<4&&c[q+b[i]][p+a[i]]==0){	
	c[q+b[i]][p+a[i]]=-1;
	ct+=fn(p==3?0:p+1,p==3?q+1:q);
	c[q+b[i]][p+a[i]]=0;
      }
    }
    c[q][p]=0;
  }
  return ct;
}
int main(){
  int i;
  for(;;){
    for(i=0;i<4;i++)
      cin>>a[i]>>b[i];
    if(a[0]>4)
      break;
    cout<<fn(0,0)<<endl;
  }
  return 0;
}