#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
int n, m, k;
int cnt[3];
long long res;
void dfs(int cur) {
  if (cnt[cur] == 0) {
    if (cur == 0) {
      long long mul = 1;
      for (int i = (0); i <= (2); i++) {
        for (int j = (1); j <= (cnt[i]); j++) {
          mul *= 3ll;
          mul %= mod;
        }
      }
      res += mul;
      res %= mod;
    }
    return;
  }
  for (int i = (0); i <= (2); i++) {
    cnt[cur]--;
    dfs(i);
    cnt[cur]++;
  }
}
void solve() {
  cin >> n >> m >> k;
  cnt[0] = n;
  cnt[1] = m;
  cnt[2] = k;
  dfs(0);
  cout << res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (0) freopen(".in", "r", stdin);
  solve();
  return 0;
}
