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.

-----Constraints-----
 - 3 ≦ N ≦ 40
 - 1 ≦ X ≦ 5
 - 1 ≦ Y ≦ 7
 - 1 ≦ Z ≦ 5

-----Input-----
The input is given from Standard Input in the following format:
N X Y Z

-----Output-----
Print the number of the sequences that contain an X,Y,Z-Haiku, modulo 10^9+7.

-----Sample Input-----
3 5 7 5

-----Sample Output-----
1

Here, the only sequence that contains a 5,7,5-Haiku is [5, 7, 5].

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'mod = 1000000007\neps = 10**-9\n\n\ndef main():\n    import sys\n    input = sys.stdin.readline\n\n    N, x, y, z = list(map(int, input().split()))\n    s = x + y + z\n    m = max(x, y, z)\n    mask_x = (1 << (x + 1)) - 1\n    mask_y = (1 << y) - 1\n    mask_z = (1 << z) - 1\n\n    dp = [0] * (1 << s)\n    dp[1] = 1\n    for _ in range(N):\n        dp_new = [0] * (1 << s)\n        for state in range(1 << s):\n            if dp[state] == 0:\n                continue\n            state_x = state & mask_x\n            state_y = (state >> (x + 1)) & mask_y\n            state_z = (state >> (x + y + 1)) & mask_z\n            for w in range(1, m+1):\n                if z - w - 1 >= 0:\n                    if (state_z >> (z - w - 1)) & 1:\n                        continue\n                if w == z and (state_y >> (y - 1)) & 1:\n                    continue\n                state_new = ((state_x << w) & mask_x) | (((state_y << w) & mask_y) << (x + 1))\\\n                            | (((state_z << w) & mask_z) << (x + y + 1)) | 1\n                if ((state_x >> x) & 1) and w <= y:\n                    state_new |= (1 << (w + x))\n                if ((state_y >> (y - 1)) & 1) and w <= z:\n                    state_new |= (1 << (w + x + y))\n                dp_new[state_new] = (dp_new[state_new] + dp[state])%mod\n            dp_new[1] = (dp_new[1] + (dp[state] * (10 - m))%mod)%mod\n        dp = dp_new\n    ans = pow(10, N, mod)\n    for a in dp:\n        ans = (ans - a)%mod\n    print(ans)\n\n\ndef __starting_point():\n    main()\n\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 2104069