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<bits/stdc++.h>
using namespace std;

#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
typedef long long s64;
//typedef __int128 s64;
const int N=2e6+5,D=1e9+7;
s64 mi(s64 x,int y=D-2)
{
	s64 ans=1;
	while(y)
	{
		if(y&1)ans=ans*x%D;
		x=x*x%D;y>>=1; 
	}
	return ans;
}
s64 jie[N],niv_jie[N]; 
void init_jie(int n)
{
	jie[0]=1;
	rep(i,1,n)jie[i]=jie[i-1]*i%D;
	niv_jie[n]=mi(jie[n]);
	per(i,n,1)niv_jie[i-1]=niv_jie[i]*i%D;
//	rep(i,0,n)assert(jie[i]*niv_jie[i]%D==1);
}
s64 C(int n,int m)
{
	if(m<0||m>n)return 0;
//	assert(n<N);
	return jie[n]*niv_jie[m]%D*niv_jie[n-m]%D;
}
int x[6],y[6];

int main()
{
#ifdef kcz
	freopen("1.in","r",stdin);
#endif
	init_jie(N-1);
	rep(i,0,5)scanf("%d",x+i);
	rep(i,0,5)scanf("%d",y+i);
	--x[0];--y[0];
	--x[2];--y[2];
	++x[5];++y[5];
	s64 ans=0,w[2]={1,-1};
	rep(i0,0,1)
	rep(j0,0,1)
	rep(i2,4,5)
	rep(j2,4,5)
/*	rep(i0,1,1)
	rep(j0,1,1)
	rep(i2,4,4)
	rep(j2,4,4)*/ 
	rep(i1,2,3)
	rep(j1,2,3)
	{
		s64 sum=0;
		int n=x[i1]-x[i0],m=y[j1]-y[j0],_n=x[i2]-x[i0],_m=y[j2]-y[j0];
		rep(tmp,0,1)
		{
			rep(i,0,n)(sum+=(i+m)*C(m+i,i)%D*C(_n-i+_m-(m+1),_m-(m+1)))%=D;
			swap(n,m);swap(_n,_m);
		}
		ans+=sum*w[i0!=j0]*w[i2!=j2]*w[i1!=j1];
	}
	cout<<(long long)((ans%D+D)%D);
}