#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define mt make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; template struct ModInt { ModInt() :x(0) {} ModInt(long long x) :x((int)(x<0 ? MOD + x%MOD : x%MOD)) { } ModInt& operator+=(ModInt that) { x = x + that.x; if (x >= MOD)x -= MOD; return *this; } ModInt& operator-=(ModInt that) { x -= that.x; if (x<0)x += MOD; return *this; } ModInt& operator*=(ModInt that) { x = (int)((long long)x * that.x % MOD); return *this; } ModInt operator+(ModInt that) { return ModInt(*this) += that; } ModInt operator-(ModInt that) { return ModInt(*this) -= that; } ModInt operator*(ModInt that) { return ModInt(*this) *= that; } int x; }; typedef ModInt<1000000007> mint; mint f[102][102]; int main(){ ios::sync_with_stdio(false); cin.tie(0); for (int i = 0; i < 102; i++)for (int j = 0; j < 102; j++) { if (i >= 1 && j >= 1)f[i][j] = f[i - 1][j] + f[i][j - 1]; else { f[i][j] = 1; } } int n, a, b, c; cin >> n; auto g = [](int x, int y, int z) { mint res; for (int i = 1; i <= x; ++i) { res += f[i - 1][y - 1] * f[x - i][z]; } return res; }; while (n--) { cin >> a >> b >> c; mint ans = g(a, b, c) + g(b, c, a) + g(c, a, b); FOR(i, 1, a + 1)FOR(j, 1, b + 1)FOR(k, 1, c + 1) { ans += f[a - i][j - 1] * f[b - j][k - 1] * f[c - k][i - 1]; } cout << ans.x << endl; } }