import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

const MOD = 998244353;
long[] f; // 階乗
long[] finv; // 階乗の逆元

long modPow(long x, long k, long m) {
    if (k == 0) return 1;
    if (k % 2 == 0) return modPow(x * x % m, k / 2, m);
    return x * modPow(x, k - 1, m) % m;
}

void init(long n) {
    f = new long[n + 1];
    f[0] = 1;
    for (int i = 1; i <= n; i++) {
        f[i] = (i * f[i - 1]) % MOD;
    }

    finv = new long[n + 1];
    finv[n] = modPow(f[n], MOD - 2, MOD);
    for (long i = n - 1; i >= 0; i--) {
        finv[i] = (finv[i + 1] * (i + 1)) % MOD;
    }
}

long calc(long n, long a, long b, long k) {

    long nck(long n, long k) {
        return (f[n] * finv[k] % MOD) * finv[n - k] % MOD;
    }

    // ax + by = k
    long ans = 0;
    for (int x = 0; x <= n; x++) {
        if (k - a * x < 0) break;
        if ((k - a * x) % b != 0) continue;

        long y = (k - a * x) / b;
        if (y > n) continue;
        ans += nck(n, x) * nck(n, y) % MOD;
        ans %= MOD;
    }

    return ans;
}

void main() {
    auto xs = reads!long;
    long n = xs[0], a = xs[1], b = xs[2], k = xs[3];

    init(n);
    auto ans = calc(n, a, b, k);
    writeln(ans);
}