#include <bits/stdc++.h>
using namespace std;
//コピペここから

// extended Euclidean Algorithm
// ax + by = gcd(a, b)
// return : gcd(a, b)
template <typename Integer = int_fast64_t>
constexpr Integer extgcd(Integer a, Integer b, Integer &x, Integer &y) {
    Integer u = 0, v = 1, q = 0, tmp = 0;
    x = v = 1;
    y = u = 0;

    while(b) {
        q = a / b;
        x ^= u ^= x ^= u;
        u = u - q * x;
        y ^= v ^= y ^= v;
        v = v - q * y;
        a ^= b ^= a ^= b;
        b = b - q * a;
    }

    return a;
}

// mod inverse(設計が変わるかもしれません)
// return : val^(-1) mod MOD
template <uint_fast64_t MOD, typename Integer = int_fast64_t>
constexpr Integer modinv(Integer val) {
    int_fast64_t ret = 0, tmp = 0;

    extgcd<int_fast64_t>(static_cast<int_fast64_t>(val),
                         static_cast<int_fast64_t>(MOD), ret, tmp);

    return static_cast<Integer>(ret > 0 ? ret % MOD : (MOD - (-ret % MOD)));
}

// const expression factorial mod MOD
template <std::size_t N, std::uint_fast64_t MOD>
struct Fact {
    std::uint_fast64_t val[N + 1];

    constexpr Fact() : val() {
        val[0] = 1;
        for(std::size_t i = 1; i <= N; ++i) val[i] = val[i - 1] * i % MOD;
    }
};

// const expression factorial inverse mod MOD
template <std::size_t N, std::uint_fast64_t MOD, std::uint_fast64_t F>
struct IFact {
    std::uint_fast64_t val[N + 1];

    constexpr IFact() : val() {
        val[N] = F;
        for(std::size_t i = N; i; --i) val[i - 1] = val[i] * i % MOD;
    }
};

constexpr std::uint_fast64_t MOD = 998244353, maxN = 300000;

constexpr auto fact = Fact<maxN, MOD>();
constexpr auto ifact = IFact<maxN, MOD, modinv<MOD>(fact.val[maxN])>();

// const expression binomial mod MOD
constexpr std::uint_fast64_t binommod(std::uint_fast64_t n,
                                      std::uint_fast64_t r) {
    if(r < 0 || r > n) return 0;
    return fact.val[n] * (ifact.val[r] * ifact.val[n - r] % MOD) % MOD;
}

//コピペここまで(ある部分を使うためにはそれより上を全てコピーしてください)

template <std::uint_fast32_t MODULO>
struct modint {
   private:
    using uint32 = std::uint_fast32_t;
    using uint64 = std::uint_fast64_t;

   public:
    uint32 a;
    modint() : a(0) {}
    modint(const std::int_fast64_t &x) : a(set(x % MODULO + MODULO)) {}
    static uint32 set(const uint32 &x) { return (x < MODULO) ? x : x - MODULO; }
    static modint make(const uint32 &x) {
        modint ret;
        ret.a = x;
        return ret;
    }
    modint operator+(const modint &o) const { return make(set(a + o.a)); }
    modint operator-(const modint &o) const {
        return make(set(a + MODULO - o.a));
    }
    modint operator*(const modint &o) const {
        return make((uint64)a * o.a % MODULO);
    }
    modint operator/(const modint &o) const {
        return make((uint64)a * ~o % MODULO);
    }
    modint &operator+=(const modint &o) { return *this = *this + o; }
    modint &operator-=(const modint &o) { return *this = *this - o; }
    modint &operator*=(const modint &o) { return *this = *this * o; }
    modint &operator/=(const modint &o) { return *this = *this / o; }
    modint &operator^=(const modint &o) { return *this = *this ^ o; }
    modint &operator~() const { return *this ^ (MODULO - 2); }
    modint &operator-() const { return make(set(MODULO - a)); }
    modint &operator++() { return *this = make(set(a + 1)); }
    modint &operator++(int) {
        auto tmp = *this;
        ++*this;
        return tmp;
    }
    modint &operator--() { return *this = make(set(a + MODULO - 1)); }
    modint &operator--(int) {
        auto tmp = *this;
        --*this;
        return tmp;
    }
    bool operator==(const modint &o) const { return a == o.a; }
    bool operator!=(const modint &o) const { return a != o.a; }
    bool operator<(const modint &o) const { return a < o.a; }
    bool operator<=(const modint &o) const { return a <= o.a; }
    bool operator>(const modint &o) const { return a > o.a; }
    bool operator>=(const modint &o) const { return a >= o.a; }
    explicit operator bool() const { return a; }
    explicit operator uint32() const { return a; }
    modint operator^(modint n) const {
        uint32 x = (uint32)n;
        uint64 t = a, u = 1;
        while(x) {
            if(x & 1) u = u * t % MODULO;
            t = (t * t) % MODULO;
            x >>= 1;
        }
        return make(u);
    }
    friend istream &operator>>(istream &is, modint &o) {
        is >> o.a;
        return is;
    }
    friend ostream &operator<<(ostream &os, const modint &o) {
        os << o.a;
        return os;
    }
};

using mint = modint<998244353>;

int main() {
    int_fast64_t N, A, B, K, M;
    mint ans;
    cin >> N >> A >> B >> K;
    M = min(N, K / A);
    for(int i = 0; i <= M; ++i) {
        if((K - i * A) % B == 0) {
            ans += binommod(N, i) * binommod(N, (K - i * A) / B);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256