#include<bits/stdc++.h>
using namespace std;

const int mod = 1e9+7;
int n, a, b, c, dt[45][1<<17];

int main()
{
	scanf("%d%d%d%d",&n,&a,&b,&c);
	dt[0][0] = 1;
	int B = (1<<(a+b+c))-1;
	for(int i=1;i<=n;i++) {
		for(int j=0;j<=B;j++) {
			for(int k=1;k<=10;k++) {
				int C = ((j<<k) + (1<<(k-1)))&B;
				if((C & (1<<(c-1))) && (C & (1<<(b+c-1))) && (C & (1<<(a+b+c-1)))) continue;
				dt[i][C] = (dt[i][C] + dt[i-1][j]) % mod;
			}
		}
	}
	int ans = 0;
	long long n10 = 1;
	for(int i=1;i<=n;i++) {
		n10 = n10 * 10 % mod;
	}
	for(int i=0;i<=B;i++) {
		ans = (ans + dt[n][i]) % mod;
	}
	printf("%lld\n", (n10 + mod - ans) % mod);
}
