#include <iostream>
#include <cstdint>
#include <vector>
#include <limits>
#include <algorithm>

class matrix2x2 {
public:
  std::int32_t e11;
  std::int32_t e12;
  std::int32_t e21;
  std::int32_t e22;

  constexpr matrix2x2(const std::int32_t e11, const std::int32_t e12, const std::int32_t e21, const std::int32_t e22) :
    e11(e11),
    e12(e12),
    e21(e21),
    e22(e22) {
  }

  constexpr matrix2x2(const matrix2x2& other) :
    matrix2x2(other.e11, other.e12, other.e21, other.e22) {
  }

  constexpr friend matrix2x2 operator*(const matrix2x2& left, const matrix2x2& right) {
    return matrix2x2(
      left.e11 * right.e11 + left.e12 * right.e21,
      left.e11 * right.e12 + left.e12 * right.e22,
      left.e21 * right.e11 + left.e22 * right.e21,
      left.e21 * right.e12 + left.e22 * right.e22
    );
  }

  constexpr static matrix2x2 identity() {
    return matrix2x2(1, 0, 0, 1);
  }
};

class eea_tuple {
public:
  std::uint32_t gcd;
  std::int32_t x0;
  std::int32_t y0;

  eea_tuple(const std::uint32_t gcd, const std::int32_t x0, const std::int32_t y0) :
    gcd(gcd),
    x0(x0),
    y0(y0) {
  }
};

eea_tuple eea(const std::uint32_t a, const std::uint32_t b) {
  const bool is_reversed = a < b;
  std::uint32_t larger_remainder = is_reversed ? b : a;
  std::uint32_t smaller_remainder = is_reversed ? a : b;
  matrix2x2 matrix = matrix2x2::identity();
  while (smaller_remainder > 0) {
    std::uint32_t prev_larger_remainder = larger_remainder;
    std::uint32_t prev_smaller_remainder = smaller_remainder;
    larger_remainder = prev_smaller_remainder;
    smaller_remainder = prev_larger_remainder % prev_smaller_remainder;
    matrix = matrix2x2(0, 1, 1, -(prev_larger_remainder / prev_smaller_remainder)) * matrix;
  }
  return eea_tuple(larger_remainder, is_reversed ? matrix.e12 : matrix.e11, is_reversed ? matrix.e11 : matrix.e12);
}

template <std::uint32_t P> class uint_mod {
private:
  std::uint32_t m_value;

  constexpr static std::uint32_t add_impl(const std::uint32_t lhs, const std::uint32_t rhs) {
    return (lhs + rhs) % P;
  }

  constexpr static std::uint32_t sub_impl(const std::uint32_t lhs, const std::uint32_t rhs) {
    return (lhs - rhs + P) % P;
  }

  constexpr static std::uint32_t mul_impl(const std::uint32_t lhs, const std::uint32_t rhs) {
    return (std::uint32_t)(((std::uint64_t)lhs * (std::uint64_t)rhs) % P);
  }

public:
  uint_mod() :
    m_value(0) {
  }

  uint_mod(const std::uint32_t value) :
    m_value(value % P) {
  }

  uint_mod(const uint_mod<P>& other) :
    uint_mod(other.m_value) {
  }

  constexpr operator std::uint32_t() const {
    return m_value;
  }

  constexpr friend uint_mod<P> operator+(const uint_mod<P>& lhs, const uint_mod<P>& rhs) {
    return uint_mod<P>(uint_mod<P>::add_impl(lhs.m_value, rhs.m_value));
  }

  uint_mod<P>& operator+=(const uint_mod<P>& other) {
    m_value = uint_mod<P>::add_impl(m_value, other.m_value);
    return *this;
  }

  constexpr friend uint_mod<P> operator-(const uint_mod<P>& lhs, const uint_mod<P>& rhs) {
    return uint_mod<P>(uint_mod<P>::sub_impl(lhs.m_value, rhs.m_value));
  }

  uint_mod<P>& operator-=(const uint_mod<P>& other) {
    m_value = uint_mod<P>::sub_impl(m_value, other.m_value);
    return *this;
  }

  constexpr friend uint_mod<P> operator*(const uint_mod<P>& lhs, const uint_mod<P>& rhs) {
    return uint_mod<P>(uint_mod<P>::mul_impl(lhs.m_value, rhs.m_value));
  }

  uint_mod<P>& operator*=(const uint_mod<P>& other) {
    m_value = uint_mod<P>::mul_impl(m_value, other.m_value);
    return *this;
  }

  constexpr uint_mod<P> pow(const std::uint32_t exponent) const {
    return exponent == 0
      ? uint_mod<P>(1)
      : exponent % 2 == 0
        ? [](const uint_mod<P> root){ return root * root; }(this->pow(exponent / 2))
        : this->pow(exponent - 1) * *this;
  }

  constexpr uint_mod<P> inv() const {
    return this->pow(P - 2);
  }

  constexpr friend uint_mod<P> operator/(const uint_mod<P>& lhs, const uint_mod<P>& rhs) {
    return lhs * rhs.inv();
  }

  uint_mod<P>& operator/=(const uint_mod<P>& other) {
    m_value = uint_mod<P>::mul_impl(m_value, other.inv().m_value);
    return *this;
  }
};

template <std::uint32_t P> class fact_cache_mod {
private:
  std::uint32_t m_max;
  std::vector<uint_mod<P>> m_data;
  std::vector<uint_mod<P>> m_inv_data;

public:
  fact_cache_mod(const std::uint32_t max) :
    m_max(max),
    m_data(max + 1),
    m_inv_data(max + 1) {
    m_data[0] = uint_mod<P>(1);
    for (std::uint32_t i = 1; i <= max; ++i) {
      m_data[i] = m_data[i - 1] * uint_mod<P>(i);
    }
    m_inv_data[max] = m_data[max].inv();
    for (std::uint32_t i = max - 1; i != std::numeric_limits<std::uint32_t>::max(); --i) {
      m_inv_data[i] = m_inv_data[i + 1] * uint_mod<P>(i + 1);
    }
  }
  
  constexpr uint_mod<P> get(const std::uint32_t i) const {
    return m_data[i];
  }

  constexpr uint_mod<P> get_inv(const std::uint32_t i) const {
    return m_inv_data[i];
  }
};

template <typename T> constexpr T div_floor(T lhs, T rhs);
template <typename T> constexpr T div_ceil(T lhs, T rhs);

template <typename T> constexpr T div_floor(const T lhs, const T rhs) {
  static_assert(std::is_integral<T>::value, "T must be integral type.");
  return
    lhs >= 0 && rhs >= 0 ?
      lhs / rhs :
    lhs < 0 && rhs >= 0 ?
      -div_ceil<T>(-lhs, rhs) :
    lhs >= 0 && rhs < 0 ?
      -div_ceil<T>(lhs, -rhs) :
      div_floor<T>(-lhs, -rhs);
}

template <typename T> constexpr T div_ceil(const T lhs, const T rhs) {
  return
    lhs >= 0 && rhs >= 0 ?
      (lhs - 1 + rhs) / rhs :
    lhs < 0 && rhs >= 0 ?
      -div_floor<T>(-lhs, rhs) :
    lhs >= 0 && rhs < 0 ?
      -div_floor<T>(lhs, -rhs) :
      div_ceil<T>(-lhs, -rhs);
}

int main() {
  std::int64_t n, a, b, k;
  std::cin >> n >> a >> b >> k;
  constexpr const std::uint32_t p = 998244353;
  const fact_cache_mod<p> fact(n);
  const eea_tuple eea_result = eea(a, b);
  if (k % eea_result.gcd > 0) {
    std::cout << 0 << std::endl;
    return 0;
  }
  const std::int64_t a_dash = a / eea_result.gcd;
  const std::int64_t b_dash = b / eea_result.gcd;
  const std::int64_t k_dash = k / eea_result.gcd;
  const std::int64_t min_m = std::max(div_ceil<std::int64_t>(-k_dash * eea_result.y0, a_dash), div_ceil<std::int64_t>(k_dash * eea_result.x0 - n, b_dash));
  const std::int64_t max_m = std::min(div_floor<std::int64_t>(k_dash * eea_result.x0, b_dash), div_floor<std::int64_t>(n - k_dash * eea_result.y0, a_dash));
  uint_mod<p> sum(0);
  for (std::int64_t m = min_m; m <= max_m; ++m) {
    const std::int64_t x = -b_dash * m + k_dash * eea_result.x0;
    const std::int64_t y = a_dash * m + k_dash * eea_result.y0;
    sum += fact.get(n) * fact.get_inv(x) * fact.get_inv(n - x) * fact.get(n) * fact.get_inv(n - y) * fact.get_inv(y);
  }
  std::cout << (std::uint32_t)sum << std::endl;
  return 0;
}


Measured memory_bytes: 2688