#include<cstdio>
#include<iostream>
using namespace std;
int n,x,y,z,nw;
const int mod=1e9+7;
int S,f[45][1<<17],ans=1;
int main()
{
	scanf("%d",&n);
	scanf("%d%d%d",&x,&y,&z);
	for (int i=1;i<=n;i++) ans=1ll*ans*10%mod;
	nw=(1<<x-1)|(1<<x+y-1)|(1<<x+y+z-1);
	S=(1<<x+y+z)-1;
	f[0][0]=1;
	for (int i=1;i<=n;i++)
		for (int j=0;j<=S;j++)
		{
			for (int k=1;k<=10;k++)
			{
				int T=(j<<k)|(1<<k-1);
				T&=S;
				if ((T&nw)!=nw) f[i][T]=(f[i][T]+f[i-1][j])%mod;
			}
		}
	for (int i=0;i<=S;i++) ans=(ans-f[n][i]+mod)%mod;
	printf("%d",ans);
} 