#include #include using namespace std; #define DEBUG(x) cerr<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair #define pll pair template pair operator+(const pair &s, const pair &t) { return pair(s.first + t.first, s.second + t.second); } template pair operator-(const pair &s, const pair &t) { return pair(s.first - t.first, s.second - t.second); } template ostream& operator<<(ostream& os, pair p) { os << "(" << p.first << ", " << p.second << ")"; return os; } #define X first #define Y second #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 rrep1(i,n) for(int i=(n);i>0;i--) #define REP(i,a,b) for(int i=a;i bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; } #define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end()); const ll inf = 1000000001; const ll INF = (ll)1e18 + 1; const ll MOD = 1000000007; //const ll MOD = 998244353; const double pi = 3.14159265358979323846; #define Sp(p) cout< n) return 0; assert(fact[2] == 2); ll ret = fact[n]; if (rfact[r] == 0) { rfact[r] = mod_inverse(fact[r], M); } ret = (ret*rfact[r]) % M; if (rfact[n - r] == 0) { rfact[n - r] = mod_inverse(fact[n - r], M); } ret = (ret*rfact[n - r]) % M; return ret; } int a, b, c; int n; ll check(vi& d) { int aa = a, bb = b, cc = c; rep (j, n) { if (d[j] == 0) aa--; else if (d[j] == 1) bb--; else cc--; } if (aa != 0 or bb != 0 or cc != 0) { return -1; } bool af = false, bf = false, cf = false; ll res = 0; rep (j, n) { if (d[j] == 0) af = true; else if (d[j] == 1) { if (not af) { return -1; } else bf = true; } else { if (not af or not bf) { return -1; } else { cf = true; } res += mod_pow(2, n - 1 - j); res %= MOD; } } return res; } void dfs(int i, vi d, ll &res) { if (i == n) { ll temp = check(d); if (temp >= 0) { res += temp; res %= MOD; } return; } rep (j, 3) { d[i] = j; dfs(i + 1, d, res); } } ll solve() { n = a + b + c; vi d(n); ll res = 0; dfs(0, d, res); return res; } int main() { cin >> a >> b >> c; ll ans = solve(); cout << ans << endl; }