#include #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define pb push_back #define mp make_pair #define fst first #define snd second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define pii pair #define vi vector using namespace std; template ostream& operator<<(ostream& o, const pair& p) { return o << "(" << p.first << "," << p.second << ")"; } template ostream& operator<<(ostream& o, const vector& vc) { o << "sz = " << vc.size() << endl << "["; for (const T& v : vc) o << v << ","; o << "]"; return o; } using ll = long long; constexpr ll MOD = 1000000007; class Modulo { public: Modulo(const std::size_t n, const long long mod = 1000000007ULL) : m_size{n + 1}, m_mod{mod} // mod should be prime { assert(n > 0); m_fact.resize(n + 1); m_inv.resize(n + 1); m_inv_fact.resize(n + 1); m_fact[0] = 1; m_inv[0] = 1; m_inv_fact[0] = 1; m_fact[1] = 1; m_inv[1] = 1; m_inv_fact[1] = 1; for (std::size_t i = 2; i <= n; i++) { m_fact[i] = (m_fact[i - 1] * static_cast(i)) % mod; m_inv[i] = ((mod - (mod / static_cast(i))) * m_inv[static_cast(mod) % i]) % mod; m_inv_fact[i] = (m_inv_fact[i - 1] * m_inv[i]) % mod; } } long long factorial(const std::size_t n) const { assert(n < m_size); return m_fact[n]; } long long inverse(const std::size_t n) const { assert(n < m_size); return m_inv[n]; } long long inverseFactorial(const std::size_t n) const { assert(n < m_size); return m_inv_fact[n]; } long long permutation(const std::size_t n, const std::size_t k) const { assert(n < m_size); assert(k <= n); return (m_fact[n] * m_inv_fact[k]) % m_mod; } long long combination(const std::size_t n, const std::size_t k) const { assert(n < m_size); assert(k <= n); return (((m_fact[n] * m_inv_fact[k]) % m_mod) * m_inv_fact[n - k]) % m_mod; } private: const std::size_t m_size; const long long m_mod; std::vector m_fact; std::vector m_inv; std::vector m_inv_fact; }; Modulo mod(10000); ll sub(int a, int b) { return mod.combination(a + b + 1, a); } ll solve(int a, int b, int c) { ll sum = 0; rep(i, a) { sum = sum + (sub(b, i) * sub(c, a - i-1)) % MOD; sum = sum % MOD; } rep(i, b) { sum = sum + (sub(a, i) * sub(c, b - i-1)) % MOD; sum = sum % MOD; } rep(i, c) { sum = sum + (sub(a, i) * sub(b, c - i-1)) % MOD; sum = sum % MOD; } rep(i, a) { rep(j, b) { rep(k, c) { sum += ((sub(i, k) * sub(a - i-1, j)) % MOD) * sub(c - k-1, b - j-1) % MOD; sum = sum % MOD; } } } return sum; } int main() { int n; cin >> n; rep(i, n) { int a, b, c; cin >> a >> b >> c; cout << solve(a, b, c) << endl; } return 0; }