Problem: Joisino is planning on touring Takahashi Town. The town is divided into square sections by north-south and east-west lines. We will refer to the section that is the x-th from the west and the y-th from the north as (x,y).

Joisino thinks that a touring plan is good if it satisfies the following conditions:

* Let (p,q) be the section where she starts the tour. Then, X_1 \leq p \leq X_2 and Y_1 \leq q \leq Y_2 hold.

* Let (s,t) be the section where she has lunch. Then, X_3 \leq s \leq X_4 and Y_3 \leq t \leq Y_4 hold.

* Let (u,v) be the section where she ends the tour. Then, X_5 \leq u \leq X_6 and Y_5 \leq v \leq Y_6 hold.

* By repeatedly moving to the adjacent section (sharing a side), she travels from the starting section to the ending section in the shortest distance, passing the lunch section on the way.




Two touring plans are considered different if at least one of the following is different: the starting section, the lunch section, the ending section, and the sections that are visited on the way. Joisino would like to know how many different good touring plans there are. Find the number of the different good touring plans. Since it may be extremely large, find the count modulo 10^9+7.

Constraints

* 1 \leq X_1 \leq X_2 < X_3 \leq X_4 < X_5 \leq X_6 \leq 10^6
* 1 \leq Y_1 \leq Y_2 < Y_3 \leq Y_4 < Y_5 \leq Y_6 \leq 10^6

Input

Input is given from Standard Input in the following format:


X_1 X_2 X_3 X_4 X_5 X_6
Y_1 Y_2 Y_3 Y_4 Y_5 Y_6


Output

Print the number of the different good touring plans, modulo 10^9+7.

Examples

Input

1 1 2 2 3 4
1 1 2 2 3 3


Output

10


Input

1 2 3 4 5 6
1 2 3 4 5 6


Output

2346


Input

77523 89555 420588 604360 845669 973451
2743 188053 544330 647651 709337 988194


Output

137477680

Solution (in CPP):

Solution:
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cassert>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
// head

int x[10],y[10];
ll fac[2010100],fnv[2010100],ret;
ll walk(int p,int q,int r,int s) {
	r-=p; s-=q;
	return fac[r+s]*fnv[r]%mod*fnv[s]%mod;
}
ll solve(int p,int q,int r,int s) {
	ll ret=0,cur=walk(p,q,x[2],y[2])*walk(x[2],y[2],r,s)%mod;
	ret=cur;
	int px=x[2],py=y[2],qx=x[2],qy=y[2];
	rep(i,x[2]+y[2]+1,x[3]+y[3]) {
		if (py+1>y[3]) cur-=walk(p,q,px,py)*walk(px,py+1,r,s)%mod,px++;
		else cur+=walk(p,q,px-1,py+1)*walk(px,py+1,r,s)%mod,py++;
		if (qx+1>x[3]) cur-=walk(p,q,qx,qy)*walk(qx+1,qy,r,s)%mod,qy++;
		else cur+=walk(p,q,qx+1,qy-1)*walk(qx+1,qy,r,s)%mod,qx++;
//		printf("%d %d %d %d %lld\n",px,py,qx,qy,cur);
		cur%=mod;
		ret+=cur;
	}
	if (x[2]!=x[3]||y[2]!=y[3]) ret+=walk(p,q,x[3],y[3])*walk(x[3],y[3],r,s)%mod;
	ret%=mod;
//	rep(i,x[2],x[3]+1) rep(j,y[2],y[3]+1) ret+=walk(p,q,i,j)*walk(i,j,r,s)%mod;
//	exit(0);
	return ret;
} 
int main() {
	fac[0]=1;
	rep(i,1,2000004) fac[i]=fac[i-1]*i%mod;
	fnv[2000003]=powmod(fac[2000003],mod-2);
	per(i,1,2000004) fnv[i-1]=fnv[i]*i%mod;

	rep(i,0,6) scanf("%d",x+i);
	rep(i,0,6) scanf("%d",y+i);
	++x[5]; ++y[5];
	--x[0]; --y[0];
	rep(i,0,16) {
		ret+=(__builtin_popcount(i)%2?-1:1)*solve(x[i%2],y[i/2%2],x[i/4%2+4],y[i/8%2+4]);
	}
	ret%=mod;
	if (ret<0) ret+=mod;
	printf("%lld\n",ret);
}