import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines MOD = 998_244_353 def ntt_precompute(N, primitive_root): roots = np.empty(1 << N, np.int64) iroots = np.empty(1 << N, np.int64) roots[0] = iroots[0] = 1 for n in range(N): x = pow(primitive_root, (MOD - 1) >> n + 2, MOD) y = pow(x, -1, MOD) roots[1 << n:1 << n + 1] = roots[:1 << n] * x % MOD iroots[1 << n:1 << n + 1] = iroots[:1 << n] * y % MOD return roots, iroots def ntt(roots, iroots, A, inverse): """along first axis""" shape = A.shape N = len(A) if not inverse: m = N >> 1 while m: A = A.reshape((-1, m) + shape[1:]) x, y = A[::2], A[1::2] * roots[:N // m >> 1].reshape( (-1, ) + (1, ) * len(shape)) A[::2], A[1::2] = x + y, x - y A %= MOD m >>= 1 else: m = 1 while m < N: A = A.reshape((-1, m) + shape[1:]) x, y = A[::2], A[1::2] A[::2], A[1::2] = x + y, (x - y) * iroots[:N // m >> 1].reshape( (-1, ) + (1, ) * len(shape)) A %= MOD m <<= 1 invN = pow(N, -1, MOD) A = A * invN % MOD return A.reshape(shape) def mpow(A, n): n %= (MOD - 1) B = np.ones_like(A) while n: if n & 1: B = A * B % MOD A = A * A % MOD n >>= 1 return B X, Y, T, a, b, c, d = map(int, read().split()) # Z/2^(X+1)Z x Z/2^(Y+1)Z での遷移 H, W = 1 << (X + 1), 1 << (Y + 1) f = np.zeros((H, W), np.int64) f[0, 0] = f[1, 0] = f[0, 1] = f[-1, 0] = f[0, -1] = 1 # T 乗する roots, iroots = ntt_precompute(20, 3) Ff = ntt(roots, iroots, f, False) Ff = ntt(roots, iroots, Ff.T, False).T Ff = mpow(Ff, T) Ff = ntt(roots, iroots, Ff.T, True).T f = ntt(roots, iroots, Ff, True) ans = 0 ans += f[c - a, d - b] ans -= f[c - H + a, d - b] ans -= f[c - a, d - W + b] ans += f[c - H + a, d - W + b] ans %= MOD print(ans)