Three Different Numbers

All submissions for this problem are available.
This is probably the simplest problem ever. You just need to count the number of ordered triples of different numbers (X_{1}, X_{2}, X_{3}), where X_{i} could be any positive integer from 1 to N_{i}, inclusive (i = 1, 2, 3).
No, wait. I forgot to mention that numbers N_{1}, N_{2}, N_{3} could be up to 10^{18}. Well, in any case it is still quite simple :)
By the way, because of this the answer could be quite large. Hence you should output it modulo 10^{9} + 7. That is you need to find the remainder of the division of the number of required triples by 10^{9} + 7.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. The only line of each test case contains three spaceseparated integers N_{1}, N_{2}, N_{3}.
Output
For each test case, output a single line containing the number of required triples modulo 10^{9} + 7.
Constraints
 1 ≤ T ≤ 1000
 1 ≤ N_{i} ≤ 10^{18}
Example
Input: 5 3 3 3 2 4 2 1 2 3 25 12 2012 1 1 2013 Output: 6 4 1 578880 0
Explanation
Example case 1. We have the following triples composed of different numbers up to 3:
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
Example case 2. Here the triples are:
(1, 3, 2)
(1, 4, 2)
(2, 3, 1)
(2, 4, 1)
Example case 3. Here the only triple is (1, 2, 3).
Example case 4. Merry Christmas!
Example case 5. ... and Happy New Year! By the way here the answer is zero since the only choice for X_{1} and for is X_{2} is 1, so any such triple will have equal numbers.
Author:  anton_lunyov 
Tester:  anton_lunyov 
Editorial  http://discuss.codechef.com/problems/THREEDIF 
Tags  anton_lunyov, combinatorics, jan13, modulo, simple 
Date Added:  5012013 
Time Limit:  2.013 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 