#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define ii pair<int, int>
#define mp make_pair
#define iii pair< int, pair<int, ii> >
#define ll long long
#define FOR(a, b, c) for(int a = b; a <= c; ++a)
const int N = 5*1e5 + 10;
const int oo = 1e6;
const ll mod = 998244353;
const double PI = acos(-1);
int n, A, B, k;
ll fac[N], facw[N];
ll powe(ll x, ll y)
{
    if(y ==0) return 1ll;
    ll mid = powe(x, y/2);
    if(y%2) return mid * mid % mod * x % mod;
    else return mid*mid%mod;
}
ll getC(int k, int n){
    if(k > n) return 0;
    ll res = fac[n];
    res = (res * (facw[k]*facw[n - k]%mod) % mod);
    return res;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);  cout.tie(0);
    cin >> n >> A >> B >> k;
    ll sum = 0ll;
    fac[0] = 1; for(int i = 1; i <= 3*100000; ++i) fac[i] = (fac[i - 1]*i) % mod;
    facw[0] = 1;    for(int i = 1; i <= 3*100000; ++i) facw[i] = powe(fac[i], mod - 2);
    for(int i = 0; i <= n; ++i)
        if(k >= A*i && (k - A*i) % B == 0){
            int j = (k - A*i)/B;
            sum += (getC(i, n) * getC(j, n) % mod);
        }
    cout << sum;
}
