#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD=1e9+7;
int n,x[3], dp[40][1<<16];
void printbin(int n, int b = 31) {
	for(int i=b-1; i>=0; i--) printf("%d", n>>i&1);
}
int Count(int p, int b) {
	if(p==n) return 1;
	int& res=dp[p][b];
	if(res!=-1) return res;
	res=0;
	int i,t=b,c=0,f=0;
	bool chk[11]={0};
	while(t>0) t>>=1,c++;
	for(i=0;i<c;i++) {
		if(i&&(~b>>(i-1)&1)) continue;
		if(~b>>(i+x[0]-1)&1) continue;
		if(~b>>(i+x[0]+x[1]-1)&1) continue;
		t=i+x[0]+x[1]+x[2]-c;
		if(t>=1&&t<=10)
			chk[t]=1;
	}
	t=b;
	for(int i=1;i<=10;i++) {
		if(chk[i]) continue;
		while(c+i>16) {
			while(t>0&&!(t&1))t>>=1,c--;
			t>>=1,c--;
		}
		res=(res+Count(p+1,t|(1<<(c+i-1))))%MOD;
	}
	//printf("dp[%d][%d]:%d\n",p,b,res);
	//printf("dp[%d][",p); printbin(b,16); printf("]:%d\n",res);
	return res;
}
int main() {
	memset(dp,-1,sizeof(dp));
	scanf("%d%d%d%d",&n,x,x+1,x+2);
	int p=1;
	for(int i=1;i<=n;i++) p=10ll*p%MOD;
	printf("%d", (p-Count(0,0)+MOD)%MOD);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x)  x.begin(),x.end()
#define vi vector<int>
#define vll vector<ll>
#define print(x) for(auto it=x.begin();it!=x.end();it++) cout<<*it<<' '; cout<<'\n';
#define debug(a,b,c) cout << a << " " << b << " " << c << endl;
#define in(x,n) for(int e=0;e<n;e++){int y;cin>>y;x.pb(y);}
#define inl(x,n) for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}
#define lower(sl)  transform(sl.begin(), sl.end(), sl.begin(), ::tolower); 
#define endl "\n";
#define pi pair<int,int>
#define vpi vector<pair<int,int>>
#define vvi vector<vector<int>>
 
int solve(int st, vi a, int& ans,int& n){
	if(st > n ) return 0;
	int res = 0;
	int x1 = solve(st*2, a, ans, n);
	int x2 = solve(st*2+1, a, ans, n);
	int l1 = (st*2-2)>=a.size()?0:a[st*2-2];
	int l2 = (st*2-1)>=a.size()?0:a[st*2-1];
	l2 += x2; l1+=x1;
	ans += abs(l2-l1);
	return max(l1,l2); 
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//code here
	int a, b;
	cin >> a>> b;
	cout << (ll) a*b << endl;
}