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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        final int MOD = (int) 1e9 + 7;
        int[] fact;
        int[] invFact;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int[] x = new int[6];
            for (int i = 0; i < 6; ++i) {
                x[i] = in.nextInt();
            }
            int[] y = new int[6];
            for (int i = 0; i < 6; ++i) {
                y[i] = in.nextInt();
            }

            precalc(5_000_000);

            int v = x[3] - x[2] + 1;
            int ans = 0;
            for (int i = 0; i < v; ++i) {
                int vx = x[2] + i;
                int vy = y[3];
                int add = solve(x[1] - x[0], vy - y[0], vx - x[1], vy - y[1]);
                add = (int) ((long) add * (y[3] - y[2] + 1 + i) % MOD);
                vy++;
                add = (int) ((long) add * solve(x[5] - x[4], y[5] - vy, x[4] - vx, y[4] - vy) % MOD);
                ans += add;
                ans %= MOD;
            }
            for (int i = 0; i < v; ++i) {
                int vx = x[2] + i;
                int vy = y[2] - 1;
                int add = solve(x[1] - x[0], vy - y[0], vx - x[1], vy - y[1]);
                add = (int) ((long) add * i % MOD);
                vy++;
                add = (int) ((long) add * solve(x[5] - x[4], y[5] - vy, x[4] - vx, y[4] - vy) % MOD);
                ans -= add;
                ans %= MOD;
            }
            v = y[3] - y[2] + 1;
            for (int i = 0; i < v; ++i) {
                int vx = x[3];
                int vy = y[2] + i;
                int add = solve(x[1] - x[0], vy - y[0], vx - x[1], vy - y[1]);
                add = (int) ((long) add * (x[3] - x[2] + 1 + i) % MOD);
                vx++;
                add = (int) ((long) add * solve(x[5] - x[4], y[5] - vy, x[4] - vx, y[4] - vy) % MOD);
                ans += add;
                ans %= MOD;
            }

            for (int i = 0; i < v; ++i) {
                int vx = x[2] - 1;
                int vy = y[2] + i;
                int add = solve(x[1] - x[0], vy - y[0], vx - x[1], vy - y[1]);
                add = (int) ((long) add * i % MOD);
                vx++;
                add = (int) ((long) add * solve(x[5] - x[4], y[5] - vy, x[4] - vx, y[4] - vy) % MOD);
                ans -= add;
                ans %= MOD;
            }
//        int ans = 0;
//        for (int vx = x[2]; vx <= x[3]; ++vx) {
//            for (int vy = y[2]; vy <= y[3]; ++vy) {
//                ans += (long) solve(x[1] - x[0], vy - y[0], vx - x[1], vy - y[1]) *
//                        solve(x[5] - x[4], y[5] - vy, x[4] - vx, y[4] - vy) % MOD;
//                ans %= MOD;
//            }
//        }

            ans %= MOD;
            if (ans < 0) {
                ans += MOD;
            }
            out.println(ans);
            System.err.flush();
        }

        int comb(int n, int k) {
            if (k < 0 || n < 0 || k > n) {
                return 0;
            }
            return (int) ((long) fact[n] * invFact[k] % MOD * invFact[n - k] % MOD);
        }

        int solve(int x, int y, int l) {
            return (comb(l + x + y + 2, y + 1) - comb(l + y + 1, y + 1)) % MOD;
        }

        int solve(int x, int y, int l, int l1) {
            int ans = solve(x, y, l);
            if (l1 > 0) {
                ans -= solve(x, l1 - 1, l);
                ans %= MOD;
            }
            return ans;
        }

        void precalc(int n) {
            fact = new int[n];
            fact[0] = 1;
            for (int i = 1; i < n; ++i) {
                fact[i] = (int) ((long) fact[i - 1] * i % MOD);
            }
            invFact = new int[n];
            invFact[n - 1] = NumberUtils.invMod(fact[n - 1], MOD, MOD - 1);
            for (int i = n - 2; i >= 0; --i) {
                invFact[i] = (int) ((long) invFact[i + 1] * (i + 1) % MOD);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }

    static class NumberUtils {
        public static int modPow(int x, int y, int Mod) {
            int res = 1;
            for (; y > 0; y /= 2) {
                if ((y & 1) != 0) {
                    res = (int) ((long) res * x % Mod);
                }
                x = (int) ((long) x * x % Mod);
            }
            return res;
        }

        public static int invMod(int value, int Mod, int phi) {
            return modPow(value, phi - 1, Mod);
        }

    }
}