module mod_iroha_and_haiku
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer(8) :: f(0:100), invf(0:100)
contains
  subroutine init(n)
    implicit none
    integer, intent(in) :: n
    integer :: i
    f = 0_8
    invf = 0_8
    f(0) = 1_8
    invf(0) = 1_8
    do i = 1, n
      f(i) = mod(f(i-1)*int(i,8),md)
      invf(i) = inv(f(i))
    end do
    return
  end subroutine init
  integer(8) function perm(n,k)
    implicit none
    integer, intent(in) :: n, k
    perm = 0_8
    if (n.lt.0.or.k.gt.n) return
    perm = mod(f(n)*invf(n-k),md)
    return
  end function perm
  integer(8) function comb(n,k)
    implicit none
    integer, intent(in) :: n, k
    comb = mod(perm(n,k)*invf(k),md)
    return
  end function comb
  integer(8) function homo(n,k)
    implicit none
    integer, intent(in) :: n, k
    homo = comb(n+k-1,k)
    return
  end function homo
  function inv(n) result(y)
    implicit none
    integer(8), intent(in) :: n
    integer(8) :: a, b, x, y, t, q
    a = mod(n,md)
    b = md
    x = 0
    y = 1
    do while(b.ne.0_8)
      q = a/b
      t = b
      b = mod(a,b)
      a = t
      t = y
      y = x
      x = t-q*x
    end do
    do while (y.lt.0_8)
      y = y+md
    end do
    y = mod(y,md)
    return
  end function inv
  recursive function pow(a,b) result(r)
    implicit none
    integer(8), intent(in) :: a
    integer, intent(in) :: b
    integer(8) :: r
    r = 1_8
    if (b.eq.0) return
    if (mod(b,2).eq.0) then
      r = pow(a,b/2)
      r = mod(r*r,md)
      return
    end if
    r = mod(a*pow(a,b-1),md)
    return
  end function pow
end module mod_iroha_and_haiku
program iroha_and_haiku
  use mod_iroha_and_haiku
  implicit none
  integer :: n, x, y, z, i, j, k, l
  integer(8) :: m, a(10), b(10), c(10), d
  call init(100)
  a = 0_8
  b = 0_8
  c = 0_8
  read(*,*) n, x, y, z
  do i = 1, x
    a(i) = homo(i,x-i)
  end do
  do i = 1, y
    b(i) = homo(i,y-i)
  end do
  do i = 1, z
    c(i) = homo(i,z-i)
  end do
  m = 0_8
  do i = 1, x
    do j = 1, y
      do k = 1, z
        l = i+j+k
        if (l.gt.n) exit
        d = mod(int(n-l+1,8)*pow(10_8,n-l),md)
        d = mod(d*a(i),md)
        d = mod(d*b(j),md)
        d = mod(d*c(k),md)
        m = mod(m+d,md)
      end do
    end do
  end do
  write(*,'(i0)') m
  stop
end program iroha_and_haiku