mod = 998244353 max_n = 600000 # Sufficient for the problem constraints # Precompute factorials modulo mod fact = [1] * (max_n + 1) for i in range(1, max_n + 1): fact[i] = fact[i-1] * i % mod # Precompute inverse factorials modulo mod using Fermat's little theorem inv_fact = [1] * (max_n + 1) inv_fact[max_n] = pow(fact[max_n], mod - 2, mod) # Modular inverse of the last factorial for i in range(max_n - 1, -1, -1): inv_fact[i] = inv_fact[i + 1] * (i + 1) % mod def comb(n, k): if k < 0 or k > n: return 0 return fact[n] * inv_fact[k] % mod * inv_fact[n - k] % mod # Read input X, Y, Z, W = map(int, input().split()) if W == 0: # Case 1: Wolves are all expelled, remaining humans Z (W=0) H = X - Z terms = H + Y - 1 c = comb(X, H) ans = c * Y % mod ans = ans * fact[terms] % mod else: # Case 2: Humans are all expelled, remaining wolves W (Z=0) K = Y - W terms = X + K - 1 c = comb(Y, K) ans = c * X % mod ans = ans * fact[terms] % mod print(ans)