#include<bits/stdc++.h>
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define per(i,b,a) for(ll i=b;i>=a;i--)
#define mem(a,b) memset(a,b,sizeof(a))
#define MP make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5+7;
const double eps = 1e-6;
const double pi = acos(-1);
const int mod = 998244353;
using namespace std;
//拓展欧几里得算法求解丢番图方程 ax+by=c
ll exgcd(ll a,ll b,ll &x,ll &y)
{
    if(b==0)
    {
        x=1;
        y=0;
        return a;
    }
    else
    {
        ll d=exgcd(b,a%b,y,x);
        y-=a/b*x;
        /*ll d=exgcd(b,a%b,x,y);
        ll t=y;
        y=x-a/b*y;
        x=t;*/
        return d;
    }
}
ll inv(ll a,ll p)//拓展欧几里得求逆元
{
    ll x,k;
    ll d=exgcd(a,p,x,k);
    if(d!=1) return -1;
    else return (x%p+p)%p;
}
ll fac[1000002];
void factorial()//求maxn以内的数的阶乘%p
{
    fac[0] = fac[1] = 1;
    for(ll i = 2; i < maxn; i++)
        fac[i] = fac[i - 1] * i % mod;
}
ll C(ll a, ll b)//计算C(a, b)
{
    return fac[a] * inv(fac[b], mod) % mod* inv(fac[a - b], mod) % mod;
}
int main(){
    factorial();
    ll n,a,b,k;
    cin>>n>>a>>b>>k;
    ll ans=0;
    for(ll x=0;x<=n;x++){
        if(a*x>k) break;
        if((k-a*x)%b!=0) continue;
        ll y=(k-a*x)/b;
        ans+=C(n,x)*C(n,y)%mod;
        ans%=mod;
    }
    printf("%lld\n",ans);
}
