#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

    const int MOD = 1000 * 1000 * 1000 + 7;
    const int N = (int)2.01e6;

    int fct[N], ofct[N];
    char ispr[N];
    vector<int> pr;

    void add(int &a, int b) {
        a = (a + b) % MOD;
    }

    int getC(int n, int k) {
        if (k < 0 || n < k || n < 0) return 0;
        return 1LL * fct[n] * ofct[k] % MOD * ofct[n - k] % MOD;
    }

    int bin(int a, int n) {
        int res = 1;
        while (n) {
            if (n & 1) res = 1LL * res * a % MOD;
            a = 1LL * a * a % MOD;
            n >>= 1;
        }
        return res;
    }

    int inv(int x) {
        return bin(x, MOD - 2);
    }

    // slower, but works for non-prime modulo m
    int rev(int x, int m) {
        if (x == 1) return 1;
        return (1 - rev(m % x, x) * (ll)m) / x + m;
    }

    void init() {
        fct[0] = 1;
        for (int i = 1; i < N; i++) fct[i] = 1LL * fct[i - 1] * i % MOD;
        ofct[N - 1] = inv(fct[N - 1]);
        for (int i = N - 2; i >= 0; i--) ofct[i] = 1LL * ofct[i + 1] * (i + 1) % MOD;

        memset(ispr, 1, sizeof(ispr));
        for (int i = 2; i < N; i++) {
            if (!ispr[i]) continue;
            pr.push_back(i);
            for (int j = i + i; j < N; j += i) ispr[j] = 0;
        }
    }

    bool isPrime(int x) {
        if (x < N) return ispr[x];
        for (int i = 0; i < (int)pr.size() && 1LL * pr[i] * pr[i] <= x; i++) {
            if (x % pr[i] == 0) {
                return 0;
            }
        }
        return 1;
    }

int ways(int x1, int y1, int x2, int y2) {
    int dx = abs(x2 - x1), dy = abs(y2 - y1);
    return getC(dx + dy, dx);
}

int main() {
#ifdef HOME
    assert(freopen("in", "r", stdin));
#endif
    init();

    int x1, y1, x2, y2, x3, y3;
    int x4, y4, x5, y5, x6, y6;
    while (cin >> x1 >> x2 >> x3 >> x4 >> x5 >> x6) {
        cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6;
        vector<pair<pair<int, int>, int> > start;
        vector<pair<pair<int, int>, int> > finish;

        start.push_back({{x1 - 1, y1 - 1}, 1});
        start.push_back({{x2, y1 - 1}, -1});
        start.push_back({{x1 - 1, y2}, -1});
        start.push_back({{x2, y2}, 1});

        finish.push_back({{x6 + 1, y6 + 1}, 1});
        finish.push_back({{x5, y6 + 1}, -1});
        finish.push_back({{x6 + 1, y5}, -1});
        finish.push_back({{x5, y5}, 1});

        int ans = 0;
        for (auto s1 : start) {
            for (auto f1 : finish) {
                int sx = s1.first.first, sy = s1.first.second;
                int fx = f1.first.first, fy = f1.first.second;
                int coef = (s1.second * f1.second + MOD) % MOD;

                int cur = 0;
                for (int y = y3; y <= y4; y++) {
                    cur = (cur + 1LL * ways(sx, sy, x4, y) * ways(x4 + 1, y, fx, fy) % MOD * (x4 + 1 + y)) % MOD;
                    cur = (cur - 1LL * ways(sx, sy, x3 - 1, y) * ways(x3, y, fx, fy) % MOD * (x3 + y) % MOD + MOD) % MOD;
                }
                for (int x = x3; x <= x4; x++) {
                    cur = (cur + 1LL * ways(sx, sy, x, y4) * ways(x, y4 + 1, fx, fy) % MOD * (x + y4 + 1)) % MOD;
                    cur = (cur - 1LL * ways(sx, sy, x, y3 - 1) * ways(x, y3, fx, fy) % MOD * (x + y3) % MOD + MOD) % MOD;
                }
                ans = ((ans + 1LL * cur * coef) % MOD + MOD) % MOD;
            }
        }
        printf("%d\n", ans);
    }


#ifdef HOME
    cerr << "time: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}

Measured memory_bytes: 19064