#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//typedef __int128_t LL;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define pb push_back
mt19937 rnd;

template<int mod>
class Modular {
public:
	int val;
	Modular(int new_val = 0) {
	    val = new_val;
	}
	Modular operator+(const Modular& ot) const {
		if (val + ot.val >= mod) return val + ot.val - mod;
		else return val + ot.val;
	}
	Modular operator-(const Modular& ot) const {
		if (val - ot.val < 0) return val - ot.val + mod;
		else return val - ot.val;
	}
	Modular operator*(const Modular& ot) const {
		return 1ll * val * ot.val % mod;
	}
	friend Modular binpow(Modular a, ll n) {
        Modular res = 1;
        for (; n; n >>= 1) {
            if (n & 1) res *= a;
            a *= a;
        }
        return res;
	}
    friend Modular inv(const Modular& a) {
        return binpow(a, mod - 2);
    }
	Modular operator/(const Modular& ot) const {
        return 1ll * val * inv(ot).val % mod;
    }
	Modular& operator++() {
        if (val + 1 == mod) return 0;
        else return val + 1;
	}
	void operator+=(const Modular& ot) {
		val += ot.val;
		if (val >= mod) {
			val -= mod;
		}
	}
	void operator-=(const Modular& ot) {
		val -= ot.val;
		if (val < 0) {
			val += mod;
		}
	}
	void operator*=(const Modular& ot) {
		val = 1ll * val * ot.val % mod;
	}
	void operator/=(const Modular& ot) {
        val = 1ll * val * inv(ot).val % mod;
	}
	bool operator==(const Modular& ot) const {
		return val == ot.val;
	}
	bool operator!=(const Modular& ot) const {
		return val != ot.val;
	}
};

template<int mod>
istream& operator>>(istream& istr, Modular<mod>& x) {
    return istr >> x.val;
}

template<int mod>
ostream& operator<<(ostream& ostr, const Modular<mod>& x) {
	return ostr << x.val;
}

const int mod = 1000000007;
using Mint = Modular<mod>;

const int N = 45;
Mint fact[N], inv_fact[N];
Mint dp[2][N][(1 << 16)];

void init() {
    fact[0] = 1;
    for (int i = 1; i <= N - 1; i++) {
        fact[i] = fact[i - 1] * i;
    }
    inv_fact[N - 1] = inv(fact[N - 1]);
    for (int i = N - 2; i >= 0; i--) {
        inv_fact[i] = inv_fact[i + 1] * (i + 1);
    }
}

Mint C(int n, int k) {
    if (n < 0 || k < 0) return 0;
    return n >= k ? fact[n] * inv_fact[k] * inv_fact[n - k] : 0;
}

bool getBit(int mask, int bit) {
    return mask & (1 << bit);
}

int setBit(int mask, int bit) {
    return mask | (1 << bit);
}

int unsetBit(int mask, int bit) {
    return (mask | (1 << bit)) ^ (1 << bit);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    init();
    int n, x, y, z;
    cin >> n >> x >> y >> z;
    for (int j = 1; j <= 10; j++) {
        dp[0][1][(1 << (j - 1))] = 1;
    }
    for (int i = 2; i <= n; i++) {
        for (int t = 1; t <= 10; t++) {
            for (int mask = 1; mask < (1 << 16); mask++) {
                int nxt = (mask << t) | (1 << (t - 1));
                nxt &= (1 << 16) - 1;
                if (getBit(nxt, z - 1) && getBit(nxt, z + y - 1) && getBit(mask, z + y + x - t - 1)) {
                    dp[1][i][nxt] += dp[0][i - 1][mask] + dp[1][i - 1][mask];
                }
                else {
                    dp[0][i][nxt] += dp[0][i - 1][mask];
                    dp[1][i][nxt] += dp[1][i - 1][mask];
                }
            }
        }
    }
    Mint ans = 0;
    for (int mask = 1; mask < (1 << 16); mask++) {
        ans += dp[1][n][mask];
    }
    cout << ans << "\n";

#ifdef LOCAL
    cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 26648