#include <bits/stdc++.h>
using namespace std;
using ll = long long int;

ll N, A, B, K;
ll M = 998244353;

ll p(ll x, ll y) {
    if (y == 0)
        return 1;
    return (((y & 1) ? x : 1) * p((x*x)%M, y/2))%M;
}

vector<ll> fact;
ll c_n_k(ll n, ll k) {
    return (fact[n] * p( (fact[n-k]*fact[k])%M, M - 2))%M;
}

int main(int, char**) {

    cin >> N >> A >> B >> K;
    fact.resize(N+1, 0);
    fact[0] = fact[1] = 1;
    for (int i = 2; i <= N; ++i)
        fact[i] = (i * fact[i-1])%M;

    ll res = 0;
    for (ll a = 0; a <= N; ++a) {
        if (K - A*a < 0 || (K - A*a)%B != 0)
            continue;

        ll b = (K - A*a)/B;
        if (max(a,b) > N) continue;
        res = (res + (c_n_k(N, a) * c_n_k(N, b))%M)%M;
    }

    cout << res << endl;

    return 0;
}
