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;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define Rep(i,a,b) for(register int i=(a);i<=int(b);++i)
#define Dep(i,a,b) for(register int i=(a);i>=int(b);--i)
#define rep(i,a,b) for(register int i=(a);i<int(b);++i)
#define mem(x,v) memset(x,v,sizeof(x))
#define fi first
#define se second
#define gc getchar
#define pc putchar
inline ll rd(){
    ll x=0,f=1;char c=gc();
    for(;!isdigit(c);c=gc())if(c=='-')f=-1;
    for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
    return x*f;
}
inline void write(ll x){if(x<0)x=-x,pc('-');if(x>=10)write(x/10);putchar(x%10+'0');}
inline void writeln(ll x){write(x);puts("");}
const int maxn = 2e6+233;
const int mod = 1e9+7;
int fac[maxn],inv[maxn];
int C(int n,int m){
	return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;
}
inline int qpow(int a,int b){
	int ans = 1;
	for(;b;b>>=1,a=1ll*a*a%mod)if(b&1)ans=1ll*ans*a%mod;
	return ans;
}
void init(int N){
	fac[0]=1;Rep(i,1,N)fac[i]=1ll*fac[i-1]*i%mod;
	inv[N]=qpow(fac[N],mod-2);Dep(i,N-1,0)inv[i]=1ll*inv[i+1]*(i+1)%mod;
}
int go(int sx,int sy,int tx,int ty){return C(tx+ty-sx-sy,tx-sx);}
void add(int &x,int  v){
	x+=v;
	if(x>=mod)x-=mod;
	if(x<0)x+=mod;
}
int x[7],y[7],sx[2],sy[2],opt[2];
int solve(int sx,int sy,int tx,int ty){
	int ans = 0;
	for(int i=x[3];i<=x[4];++i) add(ans,-1ll*go(sx,sy,i,y[3]-1) * go(i,y[3],tx,ty) % mod * (i+y[3]) % mod);
	for(int i=y[3];i<=y[4];++i) add(ans,-1ll*go(sx,sy,x[3]-1,i) * go(x[3],i,tx,ty) % mod * (i+x[3]) % mod);
	for(int i=x[3];i<=x[4];++i) add(ans,1ll*go(sx,sy,i,y[4]) * go(i,y[4]+1,tx,ty) % mod * (i+y[4]+1) % mod);
	for(int i=y[3];i<=y[4];++i) add(ans,1ll*go(sx,sy,x[4],i) * go(x[4]+1,i,tx,ty) % mod * (x[4]+1+i) % mod);
	return ans;
}
int main(){
	init(2000050);
	Rep(i,1,6) x[i] = rd();
	Rep(i,1,6) y[i] = rd();
	int ans = 0;
	rep(i,0,4){
		if(i==0) sx[0]=x[3]-x[1]  ,sy[0]=y[3]-y[1]  ,opt[0]=+1; else
		if(i==1) sx[0]=x[3]-x[2]-1,sy[0]=y[3]-y[1]  ,opt[0]=-1; else
		if(i==2) sx[0]=x[3]-x[1]  ,sy[0]=y[3]-y[2]-1,opt[0]=-1; else
		if(i==3) sx[0]=x[3]-x[2]-1,sy[0]=y[3]-y[2]-1,opt[0]=+1;
		sx[0]=x[3]-sx[0]-1,sy[0]=y[3]-sy[0]-1;
		rep(j,0,4){
			if(j==0) sx[1]=x[6]-x[4]  ,sy[1]=y[6]-y[4]  ,opt[1]=+1; else
			if(j==1) sx[1]=x[5]-x[4]-1,sy[1]=y[6]-y[4]  ,opt[1]=-1; else
			if(j==2) sx[1]=x[6]-x[4]  ,sy[1]=y[5]-y[4]-1,opt[1]=-1; else
			if(j==3) sx[1]=x[5]-x[4]-1,sy[1]=y[5]-y[4]-1,opt[1]=+1;
			sx[1]=x[4]+sx[1]+1,sy[1]=y[4]+sy[1]+1;
			add(ans,opt[0]*opt[1]*solve(sx[0],sy[0],sx[1],sy[1]));
		}			
	}writeln(ans);
	return 0;
}