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