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 pair<int, int> pii;
 
#define fst first
#define snd second
#define pb push_back
#define eb emplace_back
#define REP(i, a, b)  for(int i = (a), i##end = (b); i < i##end; ++i)
#define DREP(i, a, b) for(int i=(a-1), i##end = (b); i >=i##end; --i)
 
template <typename T> bool chkmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> bool chkmin(T& a, T b) { return a > b ? a = b, 1 : 0; }
 
const int oo = 0x3f3f3f3f;
const int N = 2000000 + 5;
const int mod = 1e9 + 7;
 
template<typename T> T read() {
    T n(0), f(1);
    char ch = getchar();
    for( ;!isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
    for( ; isdigit(ch); ch = getchar()) n = n * 10 + ch - 48; 
    return n * f;
}

LL fpm(LL base, LL exp) {
    LL res = 1;
    for(; exp > 0; exp >>= 1) {
        if(exp & 1LL)
            res = res * base % mod;
        base = base * base % mod;
    }
    return res;
}

LL fac[N + 5], inv[N + 5];
inline LL C(int n, int k) {
    return fac[n] * inv[k] % mod * inv[n-k] % mod;
}
inline LL Calc(int l1, int r1, int l2, int r2) {
    return (C(r1 + r2 + 2, r1 + 1) - C(l1 + r2 + 1, l1) - 
           (C(r1 + l2 + 1, r1 + 1) - C(l1 + l2, l1)) + (mod << 1)) % mod;
}

void init() {
    fac[0] = 1;
    for(int i = 1; i <= N; ++i) fac[i] = fac[i-1] * i % mod;
    inv[N] = fpm(fac[N], mod - 2);
    for(int i = N; i >= 1; --i) inv[i-1] = inv[i] * i % mod;
}

int X1, X2, X3, X4, X5, X6;
int Y1, Y2, Y3, Y4, Y5, Y6;

int main() {
#ifdef Wearry
    freopen("data.txt", "r", stdin);
    freopen("ans.txt", "w", stdout);
#endif

    init();
    cin >> X1 >> X2 >> X3 >> X4 >> X5 >> X6;
    cin >> Y1 >> Y2 >> Y3 >> Y4 >> Y5 >> Y6;

    LL ans = 0;

    for(int t = Y3; t <= Y4; ++ t) {
        ans = (ans + Calc(X3-1-X2, X3-1-X1, t-Y2, t-Y1) * Calc(X5-X3, X6-X3, Y5-t, Y6-t)%mod * (-X3-t)) % mod;
        ans = (ans + Calc(X4-X2, X4-X1, t-Y2, t-Y1) * Calc(X5-X4-1, X6-X4-1, Y5-t, Y6-t)%mod * (X4+t+1)) % mod;
    }
    for(int s = X3; s <= X4; ++ s) {
        ans = (ans + Calc(s-X2, s-X1, Y3-1-Y2, Y3-1-Y1) * Calc(X5-s, X6-s, Y5-Y3, Y6-Y3)%mod * (-Y3-s)) % mod;
        ans = (ans + Calc(s-X2, s-X1, Y4-Y2, Y4-Y1) * Calc(X5-s, X6-s, Y5-Y4-1, Y6-Y4-1)%mod * (Y4+s+1)) % mod;
    }

    printf("%lld\n", (ans % mod + mod) % mod);
    return 0;
}