#include <iostream>
#include <algorithm>
using namespace std;

const int dx[24] = {-3,-3,-3,-2,-2,-2,-1,-1,-1,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3};
const int dy[24] = {1,2,3,1,2,3,1,2,3,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3};
const int H = 4;
const int W = 4;
const int N = H*W;
int dp[2][1<<N];

int main() {
  int dx[4], dy[4];
  while(cin >> dx[0] && dx[0] <= 4) {
    cin >> dy[0];
    for(int i = 1; i < 4; ++i) cin >> dx[i] >> dy[i];

    fill(dp[0], dp[2], 0);
    dp[0][0] = 1;
    for(int t = 0; t < N; ++t) {
      int i = t / W; 
      int j = t % W;
      int p = t % 2;
      int q = 1 - p;
      for(int k = 0; k < (1<<N); ++k) dp[q][k] = 0;
      for(int k = 0; k < (1<<N); ++k) {
        if(k & (1<<t)) {
          dp[q][k] += dp[p][k];
        } else {
          for(int m = 0; m < 4; ++m) {
            int ni = i + dy[m];
            int nj = j + dx[m];
            int nt = ni * W + nj;
            if(ni < 0 || ni >= H) continue;
            if(nj < 0 || nj >= W) continue;
            if(k & (1<<nt)) continue;
            dp[q][k|(1<<t)|(1<<nt)] += dp[p][k];
          }
        }
      }
    }
    cout << dp[N%2][(1<<N)-1] << endl;
  }
  return 0;
}