#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MX=300010, inf=2e9, MOD=998244353;

ll n, a, b, k;
ll F[MX];

ll pw(ll a, int e){
	if(e==0) return 1;
	ll t=pw(a, e/2); t=(t*t)%MOD;
	return (e%2==0) ? t : t*a%MOD;
}

ll inv(ll a){
	return pw(a, MOD-2);
}

ll C(int n, int r){
	return F[n]*inv(F[n-r])%MOD*inv(F[r])%MOD;
}

ll count(ll a, ll b){
	return (C(n, a) * C(n, b))%MOD;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
	cin>>n>>a>>b>>k;

	ll ans=0;
	F[0]=1;
	for(int i=1; i<=n; i++) F[i]=(F[i-1]*i)%MOD;

	for(int i=0; i<=n; i++){
		ll mb=k-a*i;
		if(mb<0 || mb%b!=0 || mb/b>n) continue;
		ans=(ans+count(i, mb/b))%MOD;
	}
	cout<<ans;
	return 0;
}