#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
const int MOD = 1000000007LL;
LL dp[41][1 << 16];
int main() {
	int N, X, Y, Z;
	cin >> N >> X >> Y >> Z;
	dp[0][0] = 1;
	int mask = (1 << (X + Y + Z - 1)) - 1;
	int xyz = (1 << (X + Y + Z - 1)) | (1 << (Y + Z - 1)) | (1 << (Z - 1));
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < (1 << (X + Y + Z - 1)); j++) {
			for (int k = 1; k <= 10; k++) {
				int bit = (j << k) | (1 << (k - 1));
				if ((bit&xyz) == xyz)  continue;
				(dp[i + 1][bit&mask] += dp[i][j]) %= MOD;
			}
		}
	}
	LL ans = 1;
	for (int i = 0; i < N; i++) {
		(ans *= 10) %= MOD;
	}
	for (int i = 0; i < (1 << (X + Y + Z - 1)); i++) {
		ans = (ans - dp[N][i] + MOD) % MOD;
	}
	cout << ans << endl;
}