fun main(args: Array<String>) {
  val (n, x, y, z) = readLine()!!.split(" ").map { it.toInt() }
  val MOD = (1e9 + 7).toInt()
  val m = 1 shl (x + y + z - 1);
  val ng = (1 shl (z - 1)) or (1 shl (y + z - 1)) or (1 shl (x + y + z - 1))
  var dp = Array(n + 1) { LongArray(m) { 0L } }
  dp[0][0] = 1L
  for (i in 0 until n) {
    for (j in 1..10) {
      for (b in 0 until m) {
        var nb = ((b shl j) or (1 shl (j - 1)))
        if ((nb and ng) != ng) {
          nb = nb and (m - 1) 
          dp[i + 1][nb] = (dp[i + 1][nb] + dp[i][b]) % MOD
        }
      }
    }
  }
  var ans = 1L
  for (i in 0 until n) {
    ans = (ans * 10) % MOD
  }
  for (b in 0 until m) {
    ans = (ans - dp[n][b] + MOD) % MOD
  }
  println(ans)
}
