#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <sstream>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <numeric>
#include <bitset>
#include <ext/algorithm>
#include <ext/numeric>
#define ffor(_a,_f,_t) for(int _a=(_f),__t=(_t);_a<__t;_a++)
#define all(_v) (_v).begin() , (_v).end()
#define sz size()
#define pb push_back
#define SET(__set, val) memset(__set, val, sizeof(__set))
#define FOR(__i, __n) ffor (__i, 0, __n)
typedef long long LL; using namespace std;

int N, M, K;

const int MOD = 1000000007;

int dp[2][1001][1001];

int pow3[300000];

int main() {
	cin >> N >> M >> K;
	int c, p;
	SET(dp, 0);
	pow3[0] = 1;
	ffor (i, 1, 300000) {
		LL tmp = pow3[i - 1] * 3LL;
		tmp %= MOD;
		pow3[i] = tmp;
	}
	FOR (n, N) {
		c = n & 1;
		p = c ^ 1;
		FOR (m, M + 1)
			FOR (k, K + 1) {
				int &ret = dp[c][m][k];
				ret = 0;
				if (!n)
					ret += pow3[m + k];
				else
					ret += dp[p][m][k];
				if (ret >= MOD)
					ret -= MOD;
				if (m)
				 ret += dp[c][m - 1][k];
				if (ret >= MOD)
					ret -= MOD;
				if (k)
					ret += dp[c][m][k - 1];
				if (ret >= MOD)
					ret -= MOD;
			}
	}
	cout << dp[(N - 1) & 1][M][K] << endl;
	return 0;
}