#include<cstdio>
typedef long long LL;
const int MOD=1e9+7;
const int N=43;

int n,x,y,z;
int dp[N][1<<17];
int def,lim,ans=1;

int main() {
	scanf("%d %d %d %d",&n,&x,&y,&z);
	def|=1<<(z-1);
	def|=1<<(y+z-1);
	def|=1<<(x+y+z-1);
	lim=(1<<(x+y+z))-1;
	dp[0][0]=1;
	for(int i=1;i<=n;i++) {
		ans=10ll*ans%MOD;
		for(int s=0;s<=lim;s++) {
			if(!dp[i-1][s]) continue;
			for(int j=1;j<=10;j++) {
				int t=((s<<j)|(1<<(j-1)))&lim;
				if((t&def)!=def) {
					dp[i][t]+=dp[i-1][s];
					if(dp[i][t]>=MOD)
						dp[i][t]-=MOD;
				}
			}
		}
	}
	for(int s=0;s<=lim;s++)
		ans=(ans-dp[n][s]+MOD)%MOD;
	printf("%d\n",ans);
	return 0;
}