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

const int N = 300005;
const int MOD = 998244353;

int n, a, b;
long long k;

int fact[N], ifact[N];

int main() {
  fact[0] = 1;
  for (int i=1; i<N; i++) fact[i] = 1LL * i * fact[i-1] % MOD;
  ifact[N-1] = 337718740;
  for (int i=N-2; i>=0; i--) ifact[i] = 1LL * ifact[i+1] * (i+1) % MOD;
  
  // assert(ifact[0] == 1);
  
  scanf("%d %d %d %lld", &n, &a, &b, &k);
  
  long long ans = 0;
  for (int i=0; i<=n; i++) {
    if ((k - 1LL * i * a) % b) continue;
    long long nb = (k - 1LL * i * a) / b;
    if (nb < 0 || nb > n) continue;
    
    ans += 1LL * fact[n] * ifact[i] % MOD * ifact[n-i] % MOD *
                 fact[n] % MOD * ifact[nb] % MOD * ifact[n - nb] % MOD;
  }
  printf("%lld\n", ans % MOD);
  
  return 0;
}
