#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009
#define MOD MOD7

#define rep(i, n) for (int i = 0; i < (n); i++)

class ModInt {
private:
    long long value;
    long long mod;

    long long calcModNum(long long value) {
	if (value < 0) {
	    long long times = (-value) / this->mod + 1;
	    value += this->mod * times;
	}
	return value % this->mod;
    }

    long long extgcd(long long a, long long b, long long &x, long long &y) {
	long long g = a;
	x = 1;
	y = 0;
	if (b != 0) {
	    g = extgcd(b, a % b, y, x);
	    y -= (a / b) * x;
	}
	return g;
    }

    long long modInverse(long long a, long long b) {
	long long x, y;
	extgcd(a, b, x, y);
	return x;
    }
public:
    // コンストラクタ
    ModInt(int value, int mod) {
	this->value = (long long)value;
	this->mod = (long long)mod;
    }

    // 値を返す
    int getValue() {
	return (int)this->value;
    }

    // ModIntとの和
    ModInt operator + (ModInt obj) {
	ModInt retObj(calcModNum(this->value + obj.value), this->mod);
	return retObj;
    }
    void operator += (ModInt obj) {
	this->value = calcModNum(this->value + obj.value);
    }
    // intとの和
    ModInt operator + (int value) {
	ModInt retObj(calcModNum(this->value + (long long)value), this->mod);
	return retObj;
    }
    void operator += (int value) {
	this->value = calcModNum(this->value + (long long)value);
    }

    // ModIntとの差
    ModInt operator - (ModInt obj) {
	ModInt retObj(calcModNum(this->value - obj.value), this->mod);
	return retObj;
    }
    void operator -= (ModInt obj) {
	this->value = calcModNum(this->value - obj.value);
    }
    // intとの差
    ModInt operator - (int value) {
	ModInt retObj(calcModNum(this->value - (long long)value), this->mod);
	return retObj;
    }
    void operator -= (int value) {
	this->value = calcModNum(this->value - (long long)value);
    }

    // ModIntとの積
    ModInt operator * (ModInt obj) {
	ModInt retObj(calcModNum(this->value * obj.value), this->mod);
	return retObj;
    }
    void operator *= (ModInt obj) {
	this->value = calcModNum(this->value * obj.value);
    }
    // intとの積
    ModInt operator * (int value) {
	ModInt retObj(calcModNum(this->value * (long long)value), this->mod);
	return retObj;
    }
    void operator *= (int value) {
	this->value = calcModNum(this->value * (long long)value);
    }

    // ModIntとの商
    ModInt operator / (ModInt obj) {
	ModInt retObj(calcModNum(this->value * modInverse(obj.value, this->mod)), this->mod);
	return retObj;
    }
    void operator /= (ModInt obj) {
	this->value = calcModNum(this->value * modInverse(obj.value, this->mod));
    }
    // intとの商
    ModInt operator / (int value) {
	ModInt retObj(calcModNum(this->value * modInverse(value, this->mod)), this->mod);
	return retObj;
    }
    void operator /= (int value) {
	this->value = calcModNum(this->value * modInverse(value, this->mod));
    }
};

using namespace std;

int dp[1 << 17];
int pdp[1 << 17];

string dispBit(int num) {
    rep(i, 20) {
	cerr << ((num & (1 << 19 - i)) > 0 ? '1' : '0');
    }
    cerr << endl;
}

signed main() {
    int N, X, Y, Z;
    cin >> N >> X >> Y >> Z;

    int badNum = 1;
    badNum <<= X;
    badNum++;
    badNum <<= Y;
    badNum++;
    badNum <<= (Z - 1);

    int bitMask = (1 << 17) - 1;

    dp[0] = 1;
    pdp[0] = 1;
    rep(i, N) {
	rep(j, 1 << 17) {
	    if ((j & badNum) == badNum) continue;
	    if (pdp[j] == 0) continue;

	    rep(pk, 10) {
		int k = pk + 1;
		int next = (j << 1) + 1;
		next <<= (k - 1);
		next &= bitMask;
		
		dp[next] += pdp[j];
		dp[next] %= MOD;
	    }

	    dp[j] -= pdp[j];
	}

	rep(j, 1 << 17) {
	    pdp[j] = dp[j];
	}
    }

    ModInt ret(1, MOD);
    rep(i, N) {
	ret *= 10;
    }
    rep(i, 1 << 17) {
	if ((i & badNum) == badNum) continue;

	ret -= dp[i];
    }

    cout << ret.getValue() << endl;

    return 0;
}


Measured memory_bytes: 2304