#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; const int INF = 1e9; const ll LINF = 1e18; template ostream& operator << (ostream& out,const pair& o){ out << "(" << o.first << "," << o.second << ")"; return out; } template ostream& operator << (ostream& out,const vector V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; } template ostream& operator << (ostream& out,const vector > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; } template ostream& operator << (ostream& out,const map mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; } /* 問題文============================================================ ================================================================= 解説============================================================= ================================================================ */ const ll MOD = 1000000007; typedef vector vec; typedef vector mat; mat mul(mat&A,mat&B,const ll M){ mat C(A.size(),vec(B[0].size())); for(int i = 0; i < (int)A.size();i++){ for(int k = 0; k < (int)B.size();k++){ if(A[i][k] == 0) continue; for(int j = 0; j < B[0].size();j++){ C[i][j] = (C[i][j] + A[i][k]*B[k][j])%M; } } } return C; } mat pow(mat A,ll n,const ll M){ mat B(A.size(),vec(A.size())); for(int i = 0; i < A.size();i++){ B[i][i] = 1; } while(n > 0){ if(n&1) B= mul(B,A,M); A = mul(A,A,M); n>>=1; } return B; } const ll prime[6] = {2,3,5,7,11,13}; const ll comp[6] = {4,6,8,9,10,12}; ll solve(){ ll res = 0; ll N,P,C; cin >> N >> P >> C; ll M = 13*P + 12*C; vector> dp(P+C+1,vector(M+1)); dp[0][0] = 1; for(int k = 0; k < 6;k++){ for(int m = 0; m < M;m++){ for(int i = 0; i < P;i++){ if(dp[i][m] == 0) continue; (dp[i+1][m+prime[k]]+=dp[i][m])%=MOD; } } } for(int k = 0; k < 6;k++){ for(int m = 0; m < M;m++){ for(int i = (int)P; i < P+C;i++){ if(dp[i][m] == 0) continue; (dp[i+1][m+comp[k]]+=dp[i][m])%=MOD; } } } auto comb = dp[P+C]; mat A(M,vec(M)); for(int i = 1; i <= M;i++) A[0][i-1] = comb[i]; for(int i = 1; i < M;i++) A[i][i-1] = 1; mat B(M,vec(1,1)); mat PowA = pow(A,N+M-1,MOD); mat F = mul(PowA,B,MOD); res = F[M-1][0]; return res; } int main(void) { cin.tie(0); ios_base::sync_with_stdio(false); cout << solve() << endl; return 0; }