#Lutece1576. Icy Equat1on

Icy Equat1on

Migrated from Lutece 1576 Icy Equat1on

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

In mathematics, an equation is a statement of an equality containing one or more variables. Solving the equation consists of determining which values of the variables make the equality true.

Consider a magic equation as following:

(a+b)c=(ac)+(bc),(a + b) \oplus c = (a \oplus c) + (b \oplus c),

where ``\oplus'' means the bitwise xor operation, and both aa, bb, cc are nonnegative integers.

Find the number of the triples (a,b,c)(a, b, c) which satisfy the above equation in the range of 0aA0 \leq a \leq A, 0bB0 \leq b \leq B, 0cC0 \leq c \leq C.

There are some examples about the bitwise xor operation for binary integers: 11=01 \oplus 1 = 0, 00=00 \oplus 0 = 0, 01=10=10 \oplus 1 = 1 \oplus 0 = 1, 101011=110101 \oplus 011 = 110.

In several programming languages, such as C, C++, Java, a caret (^\wedge) is used to denote the bitwise xor operator.

Input

One line contains three integers AA, BB, and CC.

0A,B,C10180 \leq A, B, C \leq 10^{18}.

Output

The number of the triples (a,b,c)(a, b, c) which satisfy the equation modulo 109+710^9 + 7.

Samples

1 1 1
4

Note

Both (0,0,0),(0,1,0),(1,0,0),(1,1,0)(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 0) satisfy the equation in the Sample.

Resources

The 15th UESTC Programming Contest Final