output_description: Print the number of the sequences that contain an X,Y,Z-Haiku, modulo 10^9+7.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N X Y Z
attempt: #define _CRT_SECURE_NO_WARNINGS
  #define _USE_MATH_DEFINES
  #include <iostream>
  #include <iomanip>
  #include <cstdio>
  #include <cstring>
  #include <cmath>
  #include <cstdlib>
  #include <algorithm>
  #include <string>
  #include <vector>
  #include <stack>
  #include <queue>
  #include <set>
  #include <map>
  #include <functional>
  #include <utility>
  #include <tuple>
  #include <cctype>
  #include <bitset>
  using namespace std;
  #define INF 0x3f3f3f3f
  #define INFLL 0x3f3f3f3f3f3f3f3fLL
  #define MOD 1000000007
  #define mp make_pair
  #define mt make_tuple
  #define pb push_back
  typedef long long ll;
  typedef long double ld;
  typedef pair<int, int> pint;
  typedef pair<ll,ll> pll;
  typedef tuple<int,int,int> tint;
  typedef vector<int> vint;
  typedef vector<ll> vll;
  int dx[8]={0,0,-1,1,1,1,-1,-1};
  int dy[8]={-1,1,0,0,1,-1,1,-1};
  const int SIZE=2050;
  //ここまでテンプレ
  int main(){
  	int N,X,Y,Z;
  	cin>>N>>X>>Y>>Z;
  	//DP[見ている文字][直前の状態]=その状態になる数列の数
  	ll DP[41][1<<17]={};
  	DP[0][0]=1;
  	for(int i=0;i<N;i++){
  		for(int j=0;j<(1<<17);j++){
  			//1から10までの数列で、入れてもいいものを探す
  			for(int k=1;k<=10;k++){
  				//cout<<DP[i][j]<<endl;
  				//X+Y+Z-k-1bit目、Y+Z-k-1bit目、Z-k-1bit目がすべて1になっているなら、kを入れてはいけない
  				if(Z!=k && j&(1<<(X+Y+Z-k-1)) && j&(1<<(Y+Z-k-1)) && j&(1<<(Z-k-1)))
  					continue;
  				//Z==kのときは、Z-k-1bit目が立っている必要はない
  				if(Z==k && j&(1<<(X+Y+Z-k-1)) && j&(1<<(Y+Z-k-1)))
  					continue;
  				//そうでないなら、kを入れてもいいので入れる
  				int temp=(j<<k)|(1<<k-1);
  				//16bit目までを取り出す
  				int next=0;
  				for(int l=0;l<17;l++)
  					if(temp&(1<<l))
  						next|=(1<<l);
  				DP[i+1][next]+=DP[i][j];
  				DP[i+1][next]%=MOD;
  			}
  		}
  	}
  	ll ans=0;
  	for(int i=0;i<(1<<17);i++){
  		ans+=DP[N][i];
  		ans%=MOD;
  	}
  	ll ALL=1;
  	for(int i=0;i<N;i++){
  		ALL*=10;
  		ALL%=MOD;
  	}
  	cout<<(ALL+MOD-ans)%MOD<<endl;
  	return 0;
  }
problem_description: Statement
  
   _Haiku is a short form of Japanese poetry. A Haiku consists of three phrases
  with 5, 7 and 5 syllables, in this order._
  
  Iroha is looking for _X,Y,Z -Haiku_ (defined below) in integer sequences.
  
  Consider all integer sequences of length N whose elements are between 1 and
  10, inclusive. Out of those 10^N sequences, how many contain an X,Y,Z-Haiku?
  
  Here, an integer sequence a_0, a_1, ..., a_{N-1} is said to _contain an
  X,Y,Z-Haiku_ if and only if there exist four indices x, y, z, w (0 ≦ x < y < z
  < w ≦ N) such that all of the following are satisfied:
  
    * a_x + a_{x+1} + ... + a_{y-1} = X
    * a_y + a_{y+1} + ... + a_{z-1} = Y
    * a_z + a_{z+1} + ... + a_{w-1} = Z
  
  Since the answer can be extremely large, print the number modulo 10^9+7.
samples: [{"input": "3 5 7 5", "output": "1\n    \n\nHere, the only sequence that contains a 5,7,5-Haiku is [5, 7, 5].\n\n* * *"}, {"input": "4 5 7 5", "output": "34\n    \n\n* * *"}, {"input": "37 4 2 3", "output": "863912418\n    \n\n* * *"}, {"input": "40 5 7 5", "output": "562805100"}]