### BUGGY CODE ###

import numpy as np
MOD = 998244353

class Factorial:
    def __init__(self, n, mod):
        self.f = [1]
        self.mod = mod
        for j in range(1, n + 1):
            self.f.append(self.f[-1] * j % mod)
        self.i = [pow(self.f[-1], mod - 2, mod)]
        for j in range(n, 0, -1):
            self.i.append(self.i[-1] * j % mod)
        self.i.reverse()
    def factorial(self, j):
        return self.f[j]
    def ifactorial(self, j):
        return self.i[j]
    def comb(self, n, k):
        return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0

def gcd(a, b):
    if a > b:
        a, b = b, a
    if b % a == 0:
        return a
    return gcd(b % a, a)

N, A, B, K = map(int, input().split())

if A < B:
    A, B = B, A

# n = 2 * min(K // A + 2, N + 1) + 3
n = min((K + A - 1) // A, N) + 1
lcm = A * B // gcd(A, B)
step = lcm // A

lst = Factorial(N + 1, MOD) #O(N)
N_factrorial = lst.factorial(N)
ilst = np.array(lst.i, dtype = np.int64)

def calc(a, b):
    if a > b:
        a, b = b, a #必ずaのほうが小さくなる
    tmp = 0
    G = min(a, b) #緑色の最大値
    # print ('a=', a, 'b=', b)
    # print ('G=', G)
    if a == b:
        if N - a - b >= 0:
            tmp = sum(((ilst[a: : -1] * ilst[b:: -1] % MOD) * ilst[0: G + 1] % MOD) * ilst[N - a - b: N - a - b + G + 1] % MOD) % MOD
            tmp *= N_factrorial
        else:
            n = a + b - N #少なくともn枚は緑色を作らないとだめ
            # print (n)
            if n > G:
                # print ('&')
                return 0            # print (n)
            tmp = sum(((ilst[a - n: :-1] * ilst[b - n: : -1] % MOD) * ilst[n: G + 1] % MOD) * ilst[0: N - a - b + G + 1] % MOD) % MOD
            tmp *= N_factrorial
    elif N - a - b >= 0:
        # print ('Y')
        # print (ilst[a: : -1])
        # print (ilst[b: b - G - 1: -1])
        # print (ilst[0: G + 1])
        # print (ilst[N - a - b: N - a - b + G + 1])
        tmp = sum(((ilst[a: : -1] * ilst[b: b - G - 1: -1] % MOD) * ilst[0: G + 1] % MOD) * ilst[N - a - b: N - a - b + G + 1] % MOD) % MOD
        tmp *= N_factrorial
    else:
        # print ('N')
        n = a + b - N #少なくともn枚は緑色を作らないとだめ
        # print (n)
        if n > G:
            # print ('&')
            return 0
        # print (n)
        tmp = sum(((ilst[a - n: :-1] * ilst[b - n: b - G - 1: -1] % MOD) * ilst[n: G + 1] % MOD) * ilst[0: N - a - b + G + 1] % MOD) % MOD
        tmp *= N_factrorial
    # print ('tmp=', tmp)
    tmp %= MOD
    return tmp

def count(a, b):
    if a + b > 2 * N:
        return 0
    # print ('to calc')
    return calc(a, b)

def maike_satrt(step):
    for i in range(step):
        if (K - A * i) % B == 0:
            return i

start = maike_satrt(step)
# print (start, n)
ans = 0
for a in range(start, n, step): #Aの数
    if A * a > K:
        break
    # if (K - A * a) % B != 0:
    #     continue
    b = (K - A * a) // B
    # print ('a=', a, 'b=', b)
    ans += count(a, b)
    ans %= MOD

print (ans)

### FIXED CODE ###

import numpy as np
MOD = 998244353

class Factorial:
    def __init__(self, n, mod):
        self.f = [1]
        self.mod = mod
        for j in range(1, n + 1):
            self.f.append(self.f[-1] * j % mod)
        self.i = [pow(self.f[-1], mod - 2, mod)]
        for j in range(n, 0, -1):
            self.i.append(self.i[-1] * j % mod)
        self.i.reverse()
    def factorial(self, j):
        return self.f[j]
    def ifactorial(self, j):
        return self.i[j]
    def comb(self, n, k):
        return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0

def gcd(a, b):
    if a > b:
        a, b = b, a
    if b % a == 0:
        return a
    return gcd(b % a, a)

N, A, B, K = map(int, input().split())

if A < B:
    A, B = B, A

# n = 2 * min(K // A + 2, N + 1) + 3
n = min((K + A - 1) // A, N) + 1
lcm = A * B // gcd(A, B)
step = lcm // A

c = Factorial(N + 1, MOD).comb #O(N)

def calc(a, b):
    if a > b:
        a, b = b, a #必ずaのほうが小さくなる
    return (c(N, a) * c(N, b)) % MOD


def count(a, b):
    if a <= N and b <= N:
        return calc(a, b)
    return 0

def maike_satrt(step):
    for i in range(step):
        if (K - A * i) % B == 0:
            return i

start = maike_satrt(step)
# print (start, n)
ans = 0
for a in range(start, n, step): #Aの数
    if A * a > K:
        break
    # if (K - A * a) % B != 0:
    #     continue
    b = (K - A * a) // B
    # print ('a=', a, 'b=', b)
    ans += count(a, b)
    ans %= MOD

print (ans)