#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=998244353;
ll n,A,B,K,f[600005],inv[600005];
ll quick_pow(ll a,ll b){
	ll ans=1;
	for(;b;b>>=1,a=a*a%mod)
		if(b&1) ans=ans*a%mod;
	return ans;
}
ll C(int a,int b){
	return f[a]*inv[b]%mod*inv[a-b]%mod;
}
int main(){
	scanf("%lld%lld%lld%lld",&n,&A,&B,&K);
	ll ans=0;
	f[0]=inv[0]=1;
	for(int i=1;i<=600002;i++) f[i]=f[i-1]*i%mod,inv[i]=quick_pow(f[i],mod-2);
	for(ll i=0;i<=n&&A*i<=K;i++)if((K-A*i)%B==0&&(K-A*i)/B<=n)ans=(ans+C(n,i)*C(n,(K-A*i)/B))%mod;
	printf("%lld",ans);
	return 0;
}