using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class E
{
	public static void Main() => (new Solver()).Solve();
}


public class Solver
{
	public void Solve()
	{
		int N = GetInt();
		int X = GetInt();
		int Y = GetInt();
		int Z = GetInt();
		int L = X + Y + Z;
		int MASK = 1 << L;

		var dp = new ModInt[N + 1, MASK];
		dp[0, 0] = new ModInt(1);
		for(int i = 0; i < N; i++)
		{
			for(int s = 0; s < MASK; s++)
			{
				for(int a = 1; a <= 10; a++)
				{
					int t = next(s, a, MASK);
					if(containsXYZ(t, X, Y, Z))
						continue;

					dp[i + 1, t] += dp[i, s];
				}
			}
		}

		var ans = new ModInt(1);
		for(int i = 0; i < N; i++)
			ans *= 10;

		for(int s = 0; s < MASK; s++)
			ans -= dp[N, s];

		Console.WriteLine(ans.Val);
	}

	private int next(int s, int a, int MASK) => ((s << a) | (1 << (a - 1))) % MASK;

	private bool contains(int s, int x) => ((s >> x) & 1) == 1;

	private bool containsXYZ(int s, int X, int Y, int Z) => 
		contains(s, X + Y + Z - 1) && contains(s, Y + Z - 1) && contains(s, Z - 1);
}


public struct ModInt
{
	public long Mod { get; private set; }
	public long Val { get; private set; }

	public ModInt(long v)
	{
		Mod = 1000000007;
		Val = v;
	}

	public static ModInt operator+(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long tmp = x.Val + y.Val;
		if(tmp >= mod)
			tmp -= mod;
		return new ModInt(tmp);
	}


	public static ModInt operator-(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long tmp = x.Val;
		if(tmp < y.Val)
			tmp += mod;
		tmp -= y.Val;
		return new ModInt(tmp);
	}

	public static ModInt operator*(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		return new ModInt((x.Val * y.Val) % mod);
	}

	public static ModInt operator/(ModInt x, ModInt y)
	{
		long mod = x.Mod;
		long pow = mod - 2;
		long yy = y.Val;
		long inv = 1;
		while(pow > 0)
		{
			if((pow & 1) == 1)
				inv = (inv * yy) % mod;
			yy = (yy * yy) % mod;
			pow >>= 1;
		}
		return new ModInt((x.Val * inv) % mod);
	}

	public static ModInt operator+(ModInt x, long y) => x + new ModInt(y);
	public static ModInt operator-(ModInt x, long y) => x - new ModInt(y);
	public static ModInt operator*(ModInt x, long y) => x * new ModInt(y);
	public static ModInt operator/(ModInt x, long y) => x / new ModInt(y);
	public static ModInt operator++(ModInt x) => x + new ModInt(1);
	public static ModInt operator--(ModInt x) => x - new ModInt(1);
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(int N) => Enumerable.Range(0, N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(int N) => Enumerable.Range(0, N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(int N) => Enumerable.Range(0, N).Select(_ => GetDouble()).ToArray();
	public static string[] GetStrings(int N) => Enumerable.Range(0, N).Select(_ => GetString()).ToArray();
}


Measured memory_bytes: 94816