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>
const int MOD=1e9+7;
struct mint{int x;mint(int x=0):x(x){}};
inline mint operator+  (mint a,mint b){return a.x+b.x<MOD?a.x+b.x:a.x+b.x-MOD;}
inline mint operator-  (mint a){return MOD-a.x;}
inline mint operator-  (mint a,mint b){return a+-b;}
inline mint operator*  (mint a,mint b){return 1LL*a.x*b.x%MOD;}
inline mint operator<< (mint x,int y){mint r=1;for(;y;y>>=1,x=x*x)if(y&1)r=r*x;return r;}
inline mint operator~  (mint x){return x<<MOD-2;}
inline mint operator/  (mint a,mint b){return a*~b;}
inline mint&operator+= (mint&a,mint b){return a=a+b;}
inline mint&operator-= (mint&a,mint b){return a=a-b;}
inline mint&operator*= (mint&a,mint b){return a=a*b;}
inline mint&operator<<=(mint&x,int y){return x=x<<y;}
inline mint&operator/= (mint&a,mint b){return a=a/b;}
#define MN 2000000
int x1[2],y1[2],x2[2],y2[2],xl,xr,yl,yr;
mint ans,f[MN+5],rf[MN+5];
inline mint F(int n,int m){return f[n+m]*rf[n]*rf[m];}
struct P{int x,y;P(int x,int y):x(x),y(y){}};
inline mint F(const P&a,const P&b){return F(b.x-a.x,b.y-a.y);}
mint cal(int x1,int y1,int x2,int y2)
{
	P s(x1,y1),t(x2,y2),l(xl,yl),r(xr,yr);
	mint res=F(s,r)*F(r,t)*(xr+yr+1)-F(s,l)*F(l,t)*(xl+yl);int i;
	for(i=yl;++i<=yr;)res-=F(s,P(xl-1,i))*F(P(xl,i),t)*(xl+i);
	for(i=xl;++i<=xr;)res-=F(s,P(i,yl-1))*F(P(i,yl),t)*(i+yl);
	for(i=yl;i<yr;++i)res+=F(s,P(xr,i))*F(P(xr+1,i),t)*(xr+i+1);
	for(i=xl;i<xr;++i)res+=F(s,P(i,yr))*F(P(i,yr+1),t)*(i+yr+1);
	return res;
}
int main()
{
	int i;
	for(f[0]=i=1;i<=MN;++i)f[i]=f[i-1]*i;
	for(rf[i=MN]=~f[MN];i--;)rf[i]=rf[i+1]*(i+1);
	scanf("%d%d%d%d%d%d",&x1[0],&x1[1],&xl,&xr,&x2[1],&x2[0]);
	scanf("%d%d%d%d%d%d",&y1[0],&y1[1],&yl,&yr,&y2[1],&y2[0]);
	#define rep(i) for(int i=0;i<2;++i)
	rep(a)rep(b)rep(c)rep(d)ans+=cal(x1[a]-!a,y1[b]-!b,x2[c]+!c,y2[d]+!d)*(a^b^c^d?MOD-1:1);
	printf("%d",ans);
}