import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines MOD = 10**9 + 7 def cumprod(A, MOD=MOD): L = len(A) Lsq = int(L**.5 + 1) A = np.resize(A, Lsq**2).reshape(Lsq, Lsq) for n in range(1, Lsq): A[:, n] *= A[:, n - 1] A[:, n] %= MOD for n in range(1, Lsq): A[n] *= A[n - 1, -1] A[n] %= MOD return A.ravel()[:L] def make_fact(U, MOD=MOD): x = np.arange(U, dtype=np.int64) x[0] = 1 fact = cumprod(x, MOD) x = np.arange(U, 0, -1, dtype=np.int64) x[0] = pow(int(fact[-1]), MOD - 2, MOD) fact_inv = cumprod(x, MOD)[::-1] fact.flags.writeable = False fact_inv.flags.writeable = False return fact, fact_inv fact, fact_inv = make_fact(1000) def solve(A, B, C): ret = 0 for n in [A,B,C]: ret += fact[A+B+C-1] * fact_inv[n-1] % MOD * fact_inv[A+B+C-n] % MOD ret %= MOD A -= 1 B -= 1 C -= 1 for x in range(A+1): for y in range(B+1): coef = fact[A-x+y] * fact_inv[y] % MOD * fact_inv[A-x] % MOD a = fact[B-y:B-y+C+1] * fact_inv[B-y] % MOD * fact_inv[:C+1] % MOD b = fact[x:x+C+1][::-1] * fact_inv[x] % MOD * fact_inv[:C+1][::-1] % MOD a = (a * b % MOD).sum() % MOD ret += coef * a % MOD return ret % MOD N = int(readline()) m = map(int, read().split()) for a, b, c in zip(m, m, m): print(solve(a, b, c))