#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

typedef long long ll;

const ll N = 1e7 + 5, P = 998244353;

ll fac[N], inv[N], fnv[N];

void pre() {
	fnv[0] = fac[0] = inv[1] = 1;
	for(ll i = 2; i <= N; ++i) inv[i] = (P - P / i) * 1ll * inv[P % i] % P;
	for(ll i = 1; i <= N; ++i) fac[i] = fac[i - 1] % P * i % P, fnv[i] = fnv[i - 1] % P * inv[i] % P;
} 

ll C(ll a, ll b) {
	if(a < 0 or b < 0 or b > a) return 0;
	return fac[a] % P * fnv[b] % P  * fnv[a - b] % P;
}

int main(void) {
	pre();
	ll a, b, c, d;
	scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
	ll ans = 0;
	for(ll i = 0; i <= a; ++i)
		{
			if((d - i * b) % c == 0)
			{
				ll k = (d - i * b) / c;
				ans = (ans + C(a, k) % P * C(a, i)) % P;				
			}
		}
	printf("%lld", ans % P);
} 