# lru_cache によるメモ化再帰 import functools mod = 10**9+7 @functools.lru_cache(maxsize=None) def calc(a, b): if a == 1 or b == 1: return 1 return (calc(a - 1, b) + calc(a, b - 1)) % mod def solve(): a, b, c = map(int, input().split()) ans = 0 ans += calc(a, b + c + 1) ans += calc(b, c + a + 1) ans += calc(c, a + b + 1) if ans > mod: ans %= mod for i in range(a): for j in range(b): for k in range(c): x = calc(i+1, c-k) x *= calc(j+1, a-i) if x > mod: x %= mod x *= calc(k+1, b-j) if x > mod: x %= mod ans += x if ans > mod: ans %= mod return ans t = int(input()) for _ in range(t): print(solve())