#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5+5;
const ll mod = 998244353;

int n;
ll a,b,k,x,y,fac[N],rev[N];

ll qpow(ll a,ll b){
	ll r=1;
	while(b){
		if(b&1)r=r*a%mod;
		b>>=1;a=a*a%mod;
	}
	return r;
}

void init(){
	int i;
	for(fac[0]=i=1;i<N;++i)fac[i]=fac[i-1]*i%mod;
	for(rev[N-1]=qpow(fac[N-1],mod-2),i=N-2;~i;--i)rev[i]=rev[i+1]*(i+1)%mod;
}

ll C(int n,int m){
	return n<m?0:fac[n]*rev[m]%mod*rev[n-m]%mod;
}

int main(){
	init();
	cin>>n>>a>>b>>k;
	ll ans=0; 
	for(ll i=0;i<=n;++i)
	if(k>=a*i&&(k-a*i)%b==0&&(k-a*i)/b<=n){
		ll j=(k-a*i)/b;
		(ans+=C(n,i)*C(n,j)%mod)%=mod;
	}
	cout<<ans<<endl;
}