#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<class F>auto recursive(F f){return[f](auto...a){return f(f,a...);};}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int p;fixprec(int p):p(p){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.p);}

/*!* [modint] *!*/
/*+* 剰余環整数と剰余階乗 *+*/
struct int_m;
int_m invmod(int_m);
int_m powmod(int_m, i64);
struct int_m {
    static i64 m;
    i64 v;
    int_m() {}
    int_m(i64 x) : v(x) {}
    int_m operator+(const int_m &y) const { return (v + y.v) % m; }
    int_m operator-(const int_m &y) const { return (v - y.v + m) % m; }
    int_m operator*(const int_m &y) const { return (v * y.v) % m; }
    int_m operator/(const int_m &y) const { return *this * invmod(y); }
    int_m operator^(const i64   &y) const { return powmod(*this, y); }
    void operator+=(const int_m &y) { *this = *this + y; }
    void operator-=(const int_m &y) { *this = *this - y; }
    void operator*=(const int_m &y) { *this = *this * y; }
    void operator/=(const int_m &y) { *this = *this / y; }
    void operator^=(const i64   &y) { *this = *this ^ y; }
    bool operator==(const int_m &y) const { return v == y.v; }
    bool operator!=(const int_m &y) const { return v != y.v; }
    friend istream &operator>>(istream &ist, int_m m) { ist >> m.v; return ist; }
    friend ostream &operator<<(ostream &ost, int_m m) { ost << m.v; return ost; }
};
i64 int_m::m;
// O(log a)
int_m powmod(int_m a, i64 p) {
    int_m v = 1;
    for(int_m b = a; p > 0; p >>= 1, b *= b) if(p & 1) v *= b;
    return v;
}
int_m invmod(int_m x) {
    return powmod(x, x.m - 2);
}
struct ModFact {
    static vector<int_m> val, inv;
    static void Init(int N) { // O(N)
        val = vector<int_m>(++N, 1), inv = vector<int_m>(N, 1);
        for(int i = 1; i < N; i++) val[i] = val[i - 1] * i;
        inv[N - 1] = invmod(val[N - 1]);
        for(int i = N - 1; i > 0; i--) inv[i - 1] = inv[i] * i;
    }
};
vector<int_m> ModFact::val, ModFact::inv;
int_m Permutation(int n, int m) {
    if(n < m || m < 0 || n < 0) return 0;
    return ModFact::val[n] * ModFact::inv[n - m];
}
int_m Combination(int n, int m) {
    if(n < m || m < 0 || n < 0) return 0;
    return ModFact::val[n] * ModFact::inv[m] * ModFact::inv[n - m];
}
int_m Combination(vector<int> &n) {
    int s = accumulate(n.begin(), n.end(), 0);
    int_m r = ModFact::val[s];
    for(auto x : n) r *= ModFact::inv[x];
    return r;
}
int_m Multichoose(int n, int m) { return Combination(n + m - 1, m); }

/*!* [intutil] *!*/
/*+* 整数演算いろいろ *+*/
i64 divceil(i64 a, i64 b) {
    return a / b + (a > 0 && a % b ? 1 : 0);
}
i64 logceil(i64 a, i64 b) {
    for(i64 i = 0, x = 1; a >= 2; x *= a, i++) if(x <= b) return i; return 0;
}
i64 gcd(i64 a, i64 b) {
    for (i64 c; a;) c = a, a = b % a, b = c; return b;
}
i64 lcm(i64 a, i64 b) {
    return (a / gcd(a, b) * b);
}

/*!* [indef_eq] *!*/
/*+* 不定方程式 *+*/
pair<i64, i64> extended_euclid(i64 a, i64 b) {
    if (b == 0)
        return {1, 0};
    else {
        i64 x, y;
        tie(y, x) = extended_euclid(b, a % b);
        return {x, y - (a / b) * x};
    }
}

int main() {
    int_m::m = 998244353;
    ModFact::Init(4e5);
    i64 N, A, B, K;
    cin >> N >> A >> B >> K;
    i64 G = gcd(A, B);
    if(K % G != 0) {
        cout << 0 << endl;
        return 0;
    }
    A /= G, B /= G, K /= G;
    i64 X, Y;
    // Ax + By = 1
    tie(X, Y) = extended_euclid(A, B);
    X *= K, Y *= K;

    int_m ans = 0;

    i64 x = ((X % B) + B) % B;
    i64 y = Y - ((x - X) / B) * A;
    for (; x <= N && y >= 0; x += B, y -= A) {
        ans += Combination(N, x) * Combination(N, y);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6528