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>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
inline void read(int &x) {
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 2020000, mo = 1e9+7;
const ll M = 7LL*mo*mo;
inline int power(int a, int n){
	int res=1;
	while(n){
		if(n&1)res=1LL*res*a%mo;
		a=1LL*a*a%mo;n>>=1;
	}
	return res;
}
namespace yzr{
	int x1,x2,x3,x4,x5,x6;
	int y1,y2,y3,y4,y5,y6;
	int fac[N],ifac[N];
	inline int C(int n, int m){return m>=0&&m<=n?1LL*fac[n]*ifac[m]%mo*ifac[n-m]%mo:0;}
	inline ll solve3(int x, int y, int n, int m){
		ll res=0;assert(x<=n&&y<=m&&x>=0&&y>=0);//printf("solve %d %d %d %d\n",x,y,n,m);
		rep(i,0,x){res+=1LL*C(i+y,i)*C(n-i+m-y-1,n-i)%mo*(y+i);res=res<M?res:res-M;}
		rep(i,0,y){res+=1LL*C(i+x,i)*C(m-i+n-x-1,m-i)%mo*(x+i);res=res<M?res:res-M;}
	//	rep(i,0,x)rep(j,0,y)res+=1LL*C(i+j,i)*C(n-i+m-j,n-i)%mo;
		return res%mo;
	}
	inline ll solve2(int sx, int sy, int tx, int ty){
		ll res=0;
		res+=solve3(x4-sx,y4-sy,tx-sx,ty-sy);
		res+=solve3(x3-1-sx,y3-1-sy,tx-sx,ty-sy);
		res-=solve3(x3-1-sx,y4-sy,tx-sx,ty-sy);
		res-=solve3(x4-sx,y3-1-sy,tx-sx,ty-sy);
	//	rep(i,x3,x4)rep(j,y3,y4)res+=1LL*C(i-sx+j-sy,i-sx)*C(tx-i+ty-j,tx-i)%mo;
		return res;
	}
	ll solve1(int x, int y){
		ll res=0;
		res+=solve2(x,y,x5,y5);
		res+=solve2(x,y,x6+1,y6+1);
		res-=solve2(x,y,x5,y6+1);
		res-=solve2(x,y,x6+1,y5);
		return res;
	}
	void solve(){
		read(x1);read(x2);read(x3);read(x4);read(x5);read(x6);
		read(y1);read(y2);read(y3);read(y4);read(y5);read(y6);
		int mx=N-1;
		fac[0]=1;rep(i,1,mx)fac[i]=1LL*fac[i-1]*i%mo;
		ifac[mx]=power(fac[mx],mo-2);per(i,mx-1,0)ifac[i]=1LL*ifac[i+1]*(i+1)%mo;
		ll res=0;
		res+=solve1(x1-1,y1-1);
		res+=solve1(x2,y2);
		res-=solve1(x1-1,y2);
		res-=solve1(x2,y1-1);
		printf("%lld",(res%mo+mo)%mo);
	}
}
int main() {
	yzr::solve();
	return 0;
}