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 F(i, l, r) for(int i = (l), _end_ = (int)(r); i <= _end_; ++i)
#define f(i, r, l) for(int i = (r), _end_ = (int)(l); i >= _end_; --i)
#define Set(a, v) memset(a, v, sizeof(a))
#define file(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout)
using namespace std;

bool chkmin(int &a, int b) {return b < a ? a = b, 1 : 0;}
bool chkmax(int &a, int b) {return b > a ? a = b, 1 : 0;}

inline int read() {
 int x = 0, fh = 1; char ch = getchar();
    for (; !isdigit(ch); ch = getchar() ) if (ch == '-') fh = -1;
    for (; isdigit(ch); ch = getchar() ) x = (x<<1) + (x<<3) + (ch ^ '0');
    return x * fh;
}
int n;
int xx[6],yy[6];
int inv[2000005],c[2000005];
const int mod=1e9+7;
int ans;
long long qpow(long long x,long long y){
     long long res=1;
	 while(y){
	    if(y&1)res=res*x%mod;
		x=x*x%mod;
		y>>=1;
	 }
	 return res;
}
int getans(int x,int y){
   return 1ll*c[x+y]*inv[x]%mod*inv[y]%mod;
}
int calc(int x,int y){
    int res=0;
	res=(res+getans(x-xx[2],y-yy[2]))%mod;
	res=(res+getans(x-xx[1]+1,y-yy[1]+1))%mod;
	res=(res-getans(x-xx[1]+1,y-yy[2])+mod)%mod;
	res=(res-getans(x-xx[2],y-yy[1]+1)+mod)%mod;
	return res;
}
int calc2(int x,int y){
   int res=0;
   res=(res+getans(xx[5]-x,yy[5]-y))%mod;
   res=(res+getans(xx[6]-x+1,yy[6]-y+1))%mod;
   res=(res-getans(xx[6]-x+1,yy[5]-y)+mod)%mod;
   res=(res-getans(xx[5]-x,yy[6]-y+1)+mod)%mod;
   return res;
}
int main () {
	F(i,1,6)xx[i]=read();
	F(i,1,6)yy[i]=read();
	c[0]=1;
	F(i,1,2000000)c[i]=1ll*c[i-1]*i%mod;
	inv[2000000]=qpow(c[2000000],mod-2);
	f(i,1999999,0)inv[i]=1ll*(i+1)*inv[i+1]%mod;
	ans=0;
	F(i,xx[3],xx[4]){
	   ans=(ans+1ll*(mod-i-yy[3])*calc(i,yy[3]-1)%mod*calc2(i,yy[3])%mod)%mod;
	   ans=(ans+1ll*(i+yy[4]+1)*calc(i,yy[4])%mod*calc2(i,yy[4]+1)%mod)%mod;
	}
	F(i,yy[3],yy[4]){
	  ans=(ans+1ll*(mod-i-xx[3])*calc(xx[3]-1,i)%mod*calc2(xx[3],i)%mod)%mod;
	   ans=(ans+1ll*(i+xx[4]+1)*calc(xx[4],i)%mod*calc2(xx[4]+1,i)%mod)%mod;
	}
	printf("%d\n",ans);
    return 0;
}