void main(){
  import std.stdio, std.algorithm;
  
  long n, a, b, k; rd(n, a, b, k);

  const long mod=998244353;
  const int M=1_000_00*4;

  auto fact=genFact(M, mod);
  auto invFact=genInv(fact, mod);

  long comb(long nn, long rr){
    if(nn<rr) return 0;
    long ret=fact[nn]%mod;
    (ret*=invFact[rr])%=mod;
    (ret*=invFact[nn-rr])%=mod;
    return ret;
  }

  long tot=0;
  for(long x=0; x<=n; x++)if(k-a*x>=0){
    if((k-a*x)%b==0){
      long y=(k-a*x)/b;
      if(y>n) continue;
      (tot+=comb(n, x)*comb(n, y)%mod)%=mod;
    }
  }
  writeln(tot);
}

long[] genFact(int n, long mod){
  auto fact=new long[](n);
  fact[0]=fact[1]=1;
  foreach(i; 2..n) fact[i]=i*fact[i-1]%mod;
  return fact;
}

long[] genInv(long[] arr, long mod){
  auto inv=new long[](arr.length);
  inv[0]=inv[1]=1;
  foreach(i, elem; arr[1..$]) inv[i]=powmod(arr[i], mod-2, mod);
  return inv;
}

long powmod(long a, long x, long mod){
  if(x==0) return 1;
  else if(x==1) return a;
  else if(x&1) return a*powmod(a, x-1, mod)%mod;
  else return powmod(a*a%mod, x/2, mod);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x) e=l[i].to!(typeof(e));
}
