#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 3e5+1, mod = 998244353;
int n, a, b, k, ans;
int Pow [N];
int cal (int a, int b)
{
	if (b == 1) return a;
	int res = cal (a, b/2);
	res = (res*res) % mod;
	if(b % 2) res = (res * a) % mod;
	return res;
}
int Ckn (int k, int n)
{
	if (k > n) return 0LL;
	int res = Pow[n];
	res = (res * cal( (Pow[k]*Pow[n-k])%mod, mod-2)) % mod;
	return res;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> a >> b >> k;
	Pow[0] = 1;
	for(int i = 1 ; i <= n ; ++ i)
		Pow[i] = (Pow[i-1] * i) % mod;
	for(int i = 0 ; i <= n ; ++ i)
	{
		int x = i;
		int y = k - a * i;
		if (y < 0 | y % b) continue;
		y /= b;
		ans = (ans + (Ckn(x,n)*Ckn(y,n)) % mod) % mod;
	}
	cout << ans;
}