#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

ll multiply(ll x, ll y) {
    return (x % mod) * (y % mod) % mod;
}

ll modpower(ll x, ll y) {
    if (y == 0) {
        return 1;
    } else if (y == 1) {
        return x % mod;
    } else if (y % 2 == 0) {
        ll p = modpower(x, y / 2);
        return p * p % mod;
    } else {
        ll p = modpower (x, y / 2);
        return (p * p) % mod * (x % mod) % mod;
    }
}

ll dp[42][(1 << 16) + 1];

int main() {
    ll N, X, Y, Z;
    cin >> N >> X >> Y >> Z;
    REP(i, 0, 42) {
        fill(dp[i], dp[i] + (1 << 16) + 1, 0);
    }
    ll pat = 1 << (X + Y + Z - 1);
    dp[0][0] = 1;
    REP(i, 0, N) {
        REP(j, 0, pat) {
            REP(k, 1, 11) {
                ll nex = 0;
                if (k <= X) {
                    nex |= (1 << (k - 1));
                }
                REP(l, 0, X - 1) {
                    if ((j & (1 << l)) && l + 1 + k <= X) {
                        nex |= (1 << (l + k));
                    }
                }
                REP(l, 0, Y) {
                    if ((j & (1 << (X - 1 + l))) && l + k <= Y) {
                        nex |= (1 << (X - 1 + l + k));
                    }
                }
                REP(l, 0, Z) {
                    if ((j & (1 << (X - 1 + Y + l))) && l + k <= Z) {
                        if (l + k < Z) {
                            nex |= (1 << (X - 1 + Y + l + k));
                        } else {
                            nex = (1 << 16);
                            break;
                        }
                    }
                }
                dp[i + 1][nex] = (dp[i + 1][nex] + dp[i][j]) % mod;
            }
        }
    }
    // REP(i, 0, N + 1) {
    //     REP(j, 0, 100) {
    //         cout << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    ll ans = 0;
    REP(i, 0, N + 1) {
        ans = (ans + multiply(dp[i][1 << 16], modpower(10, N - i))) % mod;
        // cout << dp[i][1 << 18] << " ";
    }
    // cout << endl;
    cout << ans << endl;
}


Measured memory_bytes: 21888