Given three integer ranges , , and , your task is to find the total number of ordered triples of integers (x, y, z) that satisfy the following conditions:
x \neq y,
x \neq z,
y \neq z,
a \leq x \leq A,
b \leq y \leq B,
c \leq z \leq C.
The input consists of a single line containing six integers: , , , , , and , separated by spaces. These integers satisfy the conditions a \leq A, b \leq B, c \leq C, and -10^9 \leq a, b, c, A, B, C \leq 10^9.
Output a single integer: the number of valid triples (x, y, z) that meet the criteria, modulo (10^9).
Example 1