module mod_rgb_coloring
  implicit none
  integer(8), parameter :: m = 998244353_8
  integer(8) :: f(0:300000), invf(0:300000)
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),m)
      invf(i) = inv(f(i))
    end do
    return
  end subroutine init
  recursive function gcd(x,y) result(z)
    implicit none
    integer(8), intent(in) :: x,y
    integer(8) :: z
    if (mod(x,y).eq.0) then
      z = y
      return
    end if
    z = gcd(y,mod(x,y))
    return
  end function gcd
  integer(8) function comb(n,a,b,c)
    implicit none
    integer(8), intent(in) :: n, a, b, c
    if ((n.lt.0_8).or.(a.lt.0_8).or.(b.lt.0_8).or.(c.lt.0_8).or.(n-a-b-c.lt.0_8)) then
      comb = 0_8
      return
    end if
    if ((n.eq.0_8).and.(a.eq.0_8).and.(b.eq.0_8).and.(c.eq.0_8)) then
      comb = 1_8
      return
    end if
    if (n.eq.0_8) then
      comb = 0_8
      return
    end if
    comb = mod(f(int(n))*mod(mod(invf(int(a))*invf(int(b)),m)*mod(invf(int(c))*invf(int(n-a-b-c)),m),m),m)
    return
  end function comb
  integer(8) function inv(n)
    implicit none
    integer(8), intent(in) :: n
    integer(8) :: k(50), a, b, c, y0, y1, y2
    integer :: u, i
    if (n.eq.1_8) then
      inv = 1_8
      return
    end if
    k = 0_8
    a = m
    b = n
    u = 50
    do i = 1, 50
      k(i) = a/b
      c = a
      a = b
      b = mod(c,b)
      if (b.eq.0_8) then
        u = i-1
        exit
      end if
    end do
    y0 = 1_8
    y1 = -k(1)
    if (u.gt.1) then
      do i = 2, u
        y2 = y0-k(i)*y1
        y0 = y1
        y1 = y2
      end do
    end if
    do while (y1.lt.0_8)
      y1 = y1 + m
    end do
    inv = mod(y1,m)
    return
  end function inv
end module mod_rgb_coloring
program rgb_coloring
  use mod_rgb_coloring
  implicit none
  integer(8) :: n, a, b, k, c, x, i, j, l
  read(*,*) n, a, b, k
  if (k.eq.0_8) then
    write(*,'(i0)') 1
    stop
  end if
  call init(int(n))
  if (a.gt.b) then
    c = a
    a = b
    b = c
  end if
  c = gcd(b,a)
  if ((mod(k,c).ne.0_8).or.(k.lt.a).or.(k.gt.n*(a+b))) then
    write(*,'(i0)') 0
    stop
  end if
  a = a/c
  b = b/c
  k = k/c
  x = 0_8
  do i = min(n,k/b), 0_8, -1_8
    if ((mod(k-i*b,a).ne.0).or.((k-i*b)/a.gt.n)) cycle
    j = (k-i*b)/a
    do l = min(i,j), 0_8, -1_8
      x = mod(x+comb(n,i-l,j-l,l),m)
    end do
  end do
  write(*,'(i0)') x
  stop
end program rgb_coloring