#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
const int Mod = 1e9+7;
int S,dp[45][1<<17],ans=1;
int main()
{
    int n,x,y,z,now;
    scanf("%d%d%d%d",&n,&x,&y,&z);
    for(int i=1;i<=n;i++) ans=1LL*ans*10%Mod;
    now=(1<<(x-1))|(1<<(x+y-1))|(1<<(x+y+z-1));
    S=(1<<x+y+z)-1;
    dp[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&now)!=now) dp[i][T]=(dp[i][T]+dp[i-1][j])%Mod;
            }
        }
    }
    for(int i=0;i<=S;i++) ans=(ans-dp[n][i]+Mod)%Mod;
    printf("%d\n",ans);
    return 0;
}
