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

// #undef DEBUG
// #define DEBUG
/// {{{ DEBUG --- ///
template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { if(&o == &cerr) { o << '{'; for(size_t i = 0; i < v.size(); i++) o << v[i] << (i + 1 != v.size() ? ", " : ""); o << "}"; } else { for(size_t i = 0; i < v.size(); i++) o << v[i] << (i + 1 != v.size() ? " " : ""); } return o; }
#ifdef DEBUG
#ifdef USE_COUT
#define dump(...) (cout<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n")
#else
#define dump(...) (cerr<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n")
#endif
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":", ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream &o, tuple<T...> const &t){ o << "("; _ot<0>(o, t); o << ")"; return o; }
#else
#define dump(...) (0)
#endif
/// }}}--- ///

/// --- modulo Library {{{ ///
constexpr ll extgcd(ll a, ll b, ll& x, ll& y) {
  if(b==0) {
    x = 1; y = 0;
    return a;
  }
  ll d = extgcd(b, a % b, y, x);
  y -= (a / b) * x;
  return d;
}
constexpr ll modpow(ll a, ll b, ll mod = 1e9 + 7) {
  a = (a % mod + mod) % mod;
  ll r = 1;
  while(b){
    if(b & 1) r = r * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
constexpr ll modinv(ll a, ll mod = 1e9 + 7) {
  a = (a % mod + mod) % mod;
  ll x = 0, y = 0;
  extgcd(a, mod, x, y);
  return (x % mod + mod) % mod;
}
template<int N, int mod = int(1e9 + 7)> struct Factorial {
  int arr[N+1], inv[N+1];
  int operator[](int i) const { return arr[i]; }
  Factorial(): arr(), inv() {
    arr[0] = 1;
    for(int i = 1; i <= N; i++) {
      arr[i] = (ll) i * arr[i - 1] % mod;
    }
    inv[N] = modinv(arr[N], mod);
    for(int i = N-1; i >= 0; i--) {
      inv[i] = (ll) (i + 1) * inv[i + 1] % mod;
    }
  }
  int C(int n, int r) const {
    if(n < 0 || r < 0 || n < r) return 0;
    return (((ll) arr[n] * inv[r]) % mod * inv[n - r]) % mod;
  }
};
/// }}}--- ///

// constexpr int N = 1e5 + 10;

const int N = 3e5;
const ll mod = 998244353;
Factorial<N + 10, mod> fact;
ll n, a, b, k;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
/* ll extgcd(ll a, ll b, ll &x, ll &y) { ll d; return b == 0 ? (x = 1, y = 0, a) : (d = extgcd(b, a % b, y, x), y -= a / b * x, d); } */
/* ll modinv(ll a, ll mod = 1e9 + 7) { ll x = 0, y = 0; extgcd(a, mod, x, y); return (x + mod) % mod; } */
/* ll modpow(ll a, ll b, ll mod = 1e9 + 7) { ll r = 1; while(b) { if(b & 1) r = r * a % mod; a = a * a % mod; b >>= 1; } return r; } */

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  
  cin >> n >> a >> b >> k;
  if(k == 0) return (cout << 1 << endl, 0);
  ll x = 0, y = 0;
  ll d = extgcd(a, b, x, y);
  if(k % d != 0) {
    cout << 0 << endl;
    return 0;
  }
  x *= k / d;
  x %= b / d;
  x += b / d;
  x %= b / d;
  y = (k - a * x) / b;
  ll ans = 0;
  while(x <= n && y >= 0) {
    // うせやろ。。。
    ans += (ll) fact.C(n, x) * fact.C(n, y) % mod;
    x += b / d;
    y -= a / d;
  }
  cout << ans % mod << endl;
}



Measured memory_bytes: 2560