n,a,b,k=list(map(int,input().split()))

mod=998244353

import math

def lcm(x, y):

  return (x * y) // math.gcd(x, y)

g=math.gcd(a,b)

if k%g!=0:

  print((0))

  exit()

k//=g

a//=g

b//=g



# コンビネーション、さらに高速。あらかじめO(N)の計算をすることでのちの計算が早くなる

def cmb(n,r,mod):

  if (r<0 or r>n):

    return 0

  r=min(r,n-r)

  return g1[n]*g2[r]*g2[n-r]%mod

g1=[1,1] # g1[i]=i! % mod　:階乗

g2=[1,1] # g2[i]=(i!)^(-1) % mod　:階乗の逆元

inverse=[0,1]

for i in range(2,n+1):

  g1.append((g1[-1]*i)%mod)

  inverse.append((-inverse[mod%i]*(mod//i))%mod)

  g2.append((g2[-1]*inverse[-1])%mod)



def func(na,nb):

  ret=1

  ret*=cmb(n,na,mod)

  ret%=mod

  ret*=cmb(n,nb,mod)

  ret%=mod

  return ret



def func0(na,nb):

  ret=0

  if na<nb:na,nb=nb,na

  for nc in range(min(nb,n)+1):

    # 緑がnc 他がna-nc,nb-nc個ずつ

    reti=1

    if 0<=nc<=n and 0<=na-nc<=n and  0<=nb-nc<=n:

      reti*=g1[n]

      reti%=mod

      reti*=g2[nc]

      reti%=mod

      reti*=g2[na-nc]

      reti%=mod

      reti*=g2[nb-nc]

      reti%=mod

      reti*=g2[n+nc-na-nb]

      reti%=mod

      ret+=reti

  return ret

pat=[]

for i in range(1+k//a):

  if (k-a*i)%b==0:

    pat.append([i,(k-a*i)//b])

    break

na=pat[0][0]

nb=pat[0][1]

while nb-a>=0:

  na+=b

  nb-=a

  pat.append([na,nb])

ans=0

for na,nb in pat:

  if na>n or nb>n:continue

  ans+=func(na,nb)

  ans%=mod

print(ans)

n,a,b,k=list(map(int,input().split()))

mod=998244353



# コンビネーション、さらに高速。あらかじめO(N)の計算をすることでのちの計算が早くなる

def cmb(n,r,mod):

  if (r<0 or r>n):

    return 0

  r=min(r,n-r)

  return g1[n]*g2[r]*g2[n-r]%mod

g1=[1,1] # g1[i]=i! % mod　:階乗

g2=[1,1] # g2[i]=(i!)^(-1) % mod　:階乗の逆元

inverse=[0,1]

for i in range(2,n+1):

  g1.append((g1[-1]*i)%mod)

  inverse.append((-inverse[mod%i]*(mod//i))%mod)

  g2.append((g2[-1]*inverse[-1])%mod)



def func(na,nb):

  if 0<=na<=n and 0<=nb<=n:

    ret=1

    ret*=cmb(n,na,mod)

    ret%=mod

    ret*=cmb(n,nb,mod)

    ret%=mod

    return ret

  else:

    return 0

ans=0

for na in range(n+1):

  if (k-na*a)%b==0:

    ans+=func(na,(k-na*a)//b)

    ans%=mod

print(ans)
n, a, b, k = list(map(int, input().split()))
mod = 998244353
import math


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


g = math.gcd(a, b)
if k % g != 0:
    print((0))
    exit()
k //= g
a //= g
b //= g
# コンビネーション、さらに高速。あらかじめO(N)の計算をすることでのちの計算が早くなる
def cmb(n, r, mod):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


g1 = [1, 1]  # g1[i]=i! % mod　:階乗
g2 = [1, 1]  # g2[i]=(i!)^(-1) % mod　:階乗の逆元
inverse = [0, 1]
for i in range(2, n + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


def func(na, nb):
    ret = 1
    ret *= cmb(n, na, mod)
    ret %= mod
    ret *= cmb(n, nb, mod)
    ret %= mod
    return ret


def func0(na, nb):
    ret = 0
    if na < nb:
        na, nb = nb, na
    for nc in range(min(nb, n) + 1):
        # 緑がnc 他がna-nc,nb-nc個ずつ
        reti = 1
        if 0 <= nc <= n and 0 <= na - nc <= n and 0 <= nb - nc <= n:
            reti *= g1[n]
            reti %= mod
            reti *= g2[nc]
            reti %= mod
            reti *= g2[na - nc]
            reti %= mod
            reti *= g2[nb - nc]
            reti %= mod
            reti *= g2[n + nc - na - nb]
            reti %= mod
            ret += reti
    return ret


pat = []
for i in range(1 + k // a):
    if (k - a * i) % b == 0:
        pat.append([i, (k - a * i) // b])
        break
na = pat[0][0]
nb = pat[0][1]
while nb - a >= 0:
    na += b
    nb -= a
    pat.append([na, nb])
ans = 0
for na, nb in pat:
    if na > n or nb > n:
        continue
    ans += func(na, nb)
    ans %= mod
print(ans)

n, a, b, k = list(map(int, input().split()))
mod = 998244353
# コンビネーション、さらに高速。あらかじめO(N)の計算をすることでのちの計算が早くなる
def cmb(n, r, mod):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


g1 = [1, 1]  # g1[i]=i! % mod　:階乗
g2 = [1, 1]  # g2[i]=(i!)^(-1) % mod　:階乗の逆元
inverse = [0, 1]
for i in range(2, n + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


def func(na, nb):
    if 0 <= na <= n and 0 <= nb <= n:
        ret = 1
        ret *= cmb(n, na, mod)
        ret %= mod
        ret *= cmb(n, nb, mod)
        ret %= mod
        return ret
    else:
        return 0


ans = 0
for na in range(n + 1):
    if (k - na * a) % b == 0:
        ans += func(na, (k - na * a) // b)
        ans %= mod
print(ans)

-import math - - -def lcm(x, y): -    return (x * y) // math.gcd(x, y) - - -g = math.gcd(a, b) -if k % g != 0: -    print((0)) -    exit() -k //= g -a //= g -b //= g -    ret = 1 -    ret *= cmb(n, na, mod) -    ret %= mod -    ret *= cmb(n, nb, mod) -    ret %= mod -    return ret +    if 0 <= na <= n and 0 <= nb <= n: +        ret = 1 +        ret *= cmb(n, na, mod) +        ret %= mod +        ret *= cmb(n, nb, mod) +        ret %= mod +        return ret +    else: +        return 0 -def func0(na, nb): -    ret = 0 -    if na < nb: -        na, nb = nb, na -    for nc in range(min(nb, n) + 1): -        # 緑がnc 他がna-nc,nb-nc個ずつ -        reti = 1 -        if 0 <= nc <= n and 0 <= na - nc <= n and 0 <= nb - nc <= n: -            reti *= g1[n] -            reti %= mod -            reti *= g2[nc] -            reti %= mod -            reti *= g2[na - nc] -            reti %= mod -            reti *= g2[nb - nc] -            reti %= mod -            reti *= g2[n + nc - na - nb] -            reti %= mod -            ret += reti -    return ret - - -pat = [] -for i in range(1 + k // a): -    if (k - a * i) % b == 0: -        pat.append([i, (k - a * i) // b]) -        break -na = pat[0][0] -nb = pat[0][1] -while nb - a >= 0: -    na += b -    nb -= a -    pat.append([na, nb]) -for na, nb in pat: -    if na > n or nb > n: -        continue -    ans += func(na, nb) -    ans %= mod +for na in range(n + 1): +    if (k - na * a) % b == 0: +        ans += func(na, (k - na * a) // b) +        ans %= mod