MOD = 998244353

MAX = int(3e5 + 1)





def div(a, b):

    return a * pow(b, MOD-2, MOD) % MOD





FACT = [1] * (MAX+1)

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

    FACT[i] = (i * FACT[i-1]) % MOD

INV = [1] * (MAX+1)

INV[MAX] = div(1, FACT[MAX])

for i in range(MAX, 0, -1):

    INV[i-1] = (INV[i] * i) % MOD





def main():

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

    ans = 0

    # solve Ax + By = K

    for x in range(N+1):

        By = K - x * A

        if By >= 0 and By % B == 0 and By <= B * N:

            y = By // B

            tmp1 = FACT[N] * INV[x] * INV[N-x] % MOD

            tmp2 = FACT[N] * INV[y] * INV[N-y] % MOD

            ans = (ans + tmp1 * tmp2) % MOD

    print(ans)



if __name__ == "__main__":

    main()

MOD = 998244353

MAX = int(3e5 + 10)





def div(a, b):

    return a * pow(b, MOD-2, MOD) % MOD





FACT = [1] * (MAX+1)

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

    FACT[i] = (i * FACT[i-1]) % MOD

INV = [1] * (MAX+1)

INV[MAX] = div(1, FACT[MAX])

for i in range(MAX, 0, -1):

    INV[i-1] = (INV[i] * i) % MOD





def main():

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

    ans = 0

    # solve Ax + By = K

    for x in range(N+1):

        By = K - x * A

        if By >= 0 and By % B == 0 and By <= B * N:

            y = By // B

            tmp1 = FACT[N] * INV[x] * INV[N-x] % MOD

            tmp2 = FACT[N] * INV[y] * INV[N-y] % MOD

            ans = (ans + tmp1 * tmp2) % MOD

    print(ans)



if __name__ == "__main__":

    main()

MOD = 998244353
MAX = int(3e5 + 1)


def div(a, b):
    return a * pow(b, MOD - 2, MOD) % MOD


FACT = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    FACT[i] = (i * FACT[i - 1]) % MOD
INV = [1] * (MAX + 1)
INV[MAX] = div(1, FACT[MAX])
for i in range(MAX, 0, -1):
    INV[i - 1] = (INV[i] * i) % MOD


def main():
    N, A, B, K = list(map(int, input().split()))
    ans = 0
    # solve Ax + By = K
    for x in range(N + 1):
        By = K - x * A
        if By >= 0 and By % B == 0 and By <= B * N:
            y = By // B
            tmp1 = FACT[N] * INV[x] * INV[N - x] % MOD
            tmp2 = FACT[N] * INV[y] * INV[N - y] % MOD
            ans = (ans + tmp1 * tmp2) % MOD
    print(ans)


if __name__ == "__main__":
    main()

MOD = 998244353
MAX = int(3e5 + 10)


def div(a, b):
    return a * pow(b, MOD - 2, MOD) % MOD


FACT = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    FACT[i] = (i * FACT[i - 1]) % MOD
INV = [1] * (MAX + 1)
INV[MAX] = div(1, FACT[MAX])
for i in range(MAX, 0, -1):
    INV[i - 1] = (INV[i] * i) % MOD


def main():
    N, A, B, K = list(map(int, input().split()))
    ans = 0
    # solve Ax + By = K
    for x in range(N + 1):
        By = K - x * A
        if By >= 0 and By % B == 0 and By <= B * N:
            y = By // B
            tmp1 = FACT[N] * INV[x] * INV[N - x] % MOD
            tmp2 = FACT[N] * INV[y] * INV[N - y] % MOD
            ans = (ans + tmp1 * tmp2) % MOD
    print(ans)


if __name__ == "__main__":
    main()

-MAX = int(3e5 + 1) +MAX = int(3e5 + 10)