class Combination:

    '''

    計算量：階乗・逆元テーブルの作成O(N)

            nCkを求めるO(1)

    '''



    def __init__(self, n, MOD):

        self.fact = [1]

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

            self.fact.append(self.fact[-1] * i % MOD)

        self.inv_fact = [pow(self.fact[i] ,MOD - 2 ,MOD) for i in range(n + 1)]

        self.MOD = MOD



    def factorial(self, k):

        '''k!を求める'''

        return self.fact[k]



    def inverse_factorial(self, k):

        '''k!の逆元を求める'''

        return self.inv_fact[k]



    def combination(self, k, r):

        '''kCrを求める'''

        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD





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

MOD = 998244353

comb = Combination(n, MOD)

ans = 0

for i in range(n+1):

    if not(k - a*i >= 0 and (k - a*i) % b == 0 and (k - a*i) // b <= n):

        continue

    else:

        ai = i

        bi = (k - a*i) // b

        ans += comb.combination(n, ai) * comb.combination(n, bi)

        ans %= MOD

print(ans)

class Combination:

    """階乗とその逆元のテーブルをO(N)で事前作成し、組み合わせの計算をO(1)で行う"""

    def __init__(self, n, MOD):

        self.fact = [1]

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

            self.fact.append(self.fact[-1] * i % MOD)

        self.inv_fact = [0] * (n + 1)

        self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)

        for i in reversed(list(range(n))):

            self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD

        self.MOD = MOD



    def factorial(self, k):

        """k!を求める O(1)"""

        return self.fact[k]



    def inverse_factorial(self, k):

        """k!の逆元を求める O(1)"""

        return self.inv_fact[k]



    def permutation(self, k, r):

        """kPrを求める O(1)"""

        if k < r:

            return 0

        return (self.fact[k] * self.inv_fact[k - r]) % self.MOD



    def combination(self, k, r):

        """kCrを求める O(1)"""

        if k < r:

            return 0

        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD



    def combination2(self, k, r):

        """kCrを求める O(r) kが大きいが、r <= nを満たしているときに使用"""

        if k < r:

            return 0

        res = 1

        for l in range(r):

            res *= (k - l)

            res %= self.MOD

        return (res * self.inv_fact[r]) % self.MOD





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

MOD = 998244353

comb = Combination(10 ** 6, MOD)



ans = 0

for cnt_a in range(0, n + 1):

    point = a * cnt_a

    nokori = k - point

    if nokori >= 0 and nokori % b == 0:

        cnt_b = nokori // b

        if cnt_b > n:

            continue

        ans += comb.combination(n, cnt_a) * comb.combination(n, cnt_b)

        ans %= MOD

print((ans % MOD))
class Combination:
    """
    計算量：階乗・逆元テーブルの作成O(N)
            nCkを求めるO(1)
    """

    def __init__(self, n, MOD):
        self.fact = [1]
        for i in range(1, n + 1):
            self.fact.append(self.fact[-1] * i % MOD)
        self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]
        self.MOD = MOD

    def factorial(self, k):
        """k!を求める"""
        return self.fact[k]

    def inverse_factorial(self, k):
        """k!の逆元を求める"""
        return self.inv_fact[k]

    def combination(self, k, r):
        """kCrを求める"""
        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD


n, a, b, k = list(map(int, input().split()))
MOD = 998244353
comb = Combination(n, MOD)
ans = 0
for i in range(n + 1):
    if not (k - a * i >= 0 and (k - a * i) % b == 0 and (k - a * i) // b <= n):
        continue
    else:
        ai = i
        bi = (k - a * i) // b
        ans += comb.combination(n, ai) * comb.combination(n, bi)
        ans %= MOD
print(ans)

class Combination:
    """階乗とその逆元のテーブルをO(N)で事前作成し、組み合わせの計算をO(1)で行う"""

    def __init__(self, n, MOD):
        self.fact = [1]
        for i in range(1, n + 1):
            self.fact.append(self.fact[-1] * i % MOD)
        self.inv_fact = [0] * (n + 1)
        self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)
        for i in reversed(list(range(n))):
            self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD
        self.MOD = MOD

    def factorial(self, k):
        """k!を求める O(1)"""
        return self.fact[k]

    def inverse_factorial(self, k):
        """k!の逆元を求める O(1)"""
        return self.inv_fact[k]

    def permutation(self, k, r):
        """kPrを求める O(1)"""
        if k < r:
            return 0
        return (self.fact[k] * self.inv_fact[k - r]) % self.MOD

    def combination(self, k, r):
        """kCrを求める O(1)"""
        if k < r:
            return 0
        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD

    def combination2(self, k, r):
        """kCrを求める O(r) kが大きいが、r <= nを満たしているときに使用"""
        if k < r:
            return 0
        res = 1
        for l in range(r):
            res *= k - l
            res %= self.MOD
        return (res * self.inv_fact[r]) % self.MOD


n, a, b, k = list(map(int, input().split()))
MOD = 998244353
comb = Combination(10**6, MOD)
ans = 0
for cnt_a in range(0, n + 1):
    point = a * cnt_a
    nokori = k - point
    if nokori >= 0 and nokori % b == 0:
        cnt_b = nokori // b
        if cnt_b > n:
            continue
        ans += comb.combination(n, cnt_a) * comb.combination(n, cnt_b)
        ans %= MOD
print((ans % MOD))

-    """ -    計算量：階乗・逆元テーブルの作成O(N) -            nCkを求めるO(1) -    """ +    """階乗とその逆元のテーブルをO(N)で事前作成し、組み合わせの計算をO(1)で行う""" -        self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)] +        self.inv_fact = [0] * (n + 1) +        self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD) +        for i in reversed(list(range(n))): +            self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD -        """k!を求める""" +        """k!を求める O(1)""" -        """k!の逆元を求める""" +        """k!の逆元を求める O(1)""" +    def permutation(self, k, r): +        """kPrを求める O(1)""" +        if k < r: +            return 0 +        return (self.fact[k] * self.inv_fact[k - r]) % self.MOD + -        """kCrを求める""" +        """kCrを求める O(1)""" +        if k < r: +            return 0 + +    def combination2(self, k, r): +        """kCrを求める O(r) kが大きいが、r <= nを満たしているときに使用""" +        if k < r: +            return 0 +        res = 1 +        for l in range(r): +            res *= k - l +            res %= self.MOD +        return (res * self.inv_fact[r]) % self.MOD -comb = Combination(n, MOD) +comb = Combination(10**6, MOD) -for i in range(n + 1): -    if not (k - a * i >= 0 and (k - a * i) % b == 0 and (k - a * i) // b <= n): -        continue -    else: -        ai = i -        bi = (k - a * i) // b -        ans += comb.combination(n, ai) * comb.combination(n, bi) +for cnt_a in range(0, n + 1): +    point = a * cnt_a +    nokori = k - point +    if nokori >= 0 and nokori % b == 0: +        cnt_b = nokori // b +        if cnt_b > n: +            continue +        ans += comb.combination(n, cnt_a) * comb.combination(n, cnt_b) -print(ans) +print((ans % MOD))