#include<bits/stdc++.h>
using namespace std;
const long long mo=1e9+7;
int n,x,y,z,hk,sum;
long long ans,dp[45][1<<18];
int main(){
	scanf("%d%d%d%d",&n,&x,&y,&z);
	memset(dp,0,sizeof dp);
	hk=1<<x+y+z-1;
    hk|=1<<y+z-1;
    hk|=1<<z-1;
	sum=(1<<x+y+z)-1;
	dp[0][0]=1; ans=1;
	for(int i=1;i<=n;i++){
		ans=ans*10%mo;
		for(int j=0;j<=sum;j++){
		  if(dp[i-1][j]==0) continue;
		  for(int k=1;k<=10;k++){
		  	int now=(j<<k)|(1<<k-1); 
			now&=sum;// avoid"now"boom
		  	if((now&hk)!=hk) 
			  dp[i][now]=(dp[i][now]+dp[i-1][j])%mo;
		  }
		}
	}
	for(int j=0;j<=sum;j++) ans=(ans-dp[n][j]+mo)%mo;
	printf("%lld\n",ans);
	return 0;
}
