Rectangles

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

We have a rectangular parallelepiped of size A×B×CA \times B \times C, divided into 1×1×11 \times 1 \times 1 small cubes. The small cubes have coordinates from (0,0,0)(0, 0, 0) through (A1,B1,C1)(A-1, B-1, C-1).

Let pp, qq and rr be integers. Consider the following set of abcabc small cubes:

\\{(\ (p + i)\~\bmod\~A, (q + j)\~\bmod\~B, (r + k)\~\bmod\~C\ ) | ii, jj and kk are integers satisfying 0i\<a0 \le i \<a, 0j<b0 \le j < b, 0k<c0 \le k < c \\}

A set of small cubes that can be expressed in the above format using some integers pp, qq and rr, is called a \emph{torus cuboid} of size a×b×ca \times b \times c.

Find the number of the sets of torus cuboids of size a×b×ca \times b \times c that satisfy the following condition:

  • No two torus cuboids in the set have intersection.
  • The union of all torus cuboids in the set is the whole rectangular parallelepiped of dimensions A×B×CA \times B \times C.

Since answer may be too big, print it modulo 109+710^9+7.

입력

Input is given in the following format:

aa bb cc AA BB CC

출력

Print the number of the sets of torus cuboids of size a×b×ca \times b \times c that satisfy the condition, modulo 109+710^9+7.

제한

1a<A1001 \le a < A \le 100, 1b<B1001 \le b < B \le 100, 1c<C1001 \le c < C \le 100, all input values are integers.