#include using namespace std; #define fi first #define se second #define pb push_back using vi = vector ; using ll = long long; using vl = vector ; using pii = pair ; const ll mod = 998244353; //~ const ll mod = 1e9 + 7; ll qpow(ll a, ll b, ll m = mod) { ll r = 1, t = a; for(; b; b /= 2) { if(b & 1) r = r * t % m; t = t * t % m; } return r; } const ll P = mod, G = 3; ll INV(ll x) { return qpow(x, P - 2); } void ntt(vl &a, int op = 1) { // P: 模数, G: 原根 int n = a.size(); for (int i = 1, j = 0; i < n - 1; ++i) { for (int s = n; j ^= s >>= 1, ~j & s;) {} if (i < j) swap(a[i], a[j]); } for (int i = 1; i < n; i *= 2) { ll u = qpow(G, (P - 1) / (i * 2)); if (op == -1) u = INV(u); for (int j = 0; j < n; j += i * 2) { ll w = 1; for (int k = 0; k < i; ++k, w = w * u % P) { int x = a[j + k], y = w * a[j + k + i] % P; #define modto(x) ({if ((x) >= P) (x) -= P;}) a[j + k] = x + y; modto(a[j + k]); a[j + k + i] = x - y + P; modto(a[j + k + i]); #undef modto }}} if (op == -1) { ll inv = INV(n); for (int i = 0; i < n; ++i) a[i] = a[i] * inv % P; } } void ntt2d(vector &mat) { for (auto &vec : mat) ntt(vec); int h = mat.size(), w = mat[0].size(); for (int j = 0; j < w; j++) { vl v(h); for (int i = 0; i < h; i++) v[i] = mat[i][j]; ntt(v); for (int i = 0; i < h; i++) mat[i][j] = v[i]; } } void ntt2dinv(vector &mat) { int h = mat.size(), w = mat[0].size(); for (int j = 0; j < w; j++) { vl v(h); for (int i = 0; i < h; i++) v[i] = mat[i][j]; ntt(v, -1); for (int i = 0; i < h; i++) mat[i][j] = v[i]; } for (auto &vec : mat) ntt(vec, -1); } int main() { ios :: sync_with_stdio(false); int x, y; cin >> x >> y; ll t; cin >> t; int a, b, c, d; cin >> a >> b >> c >> d; int n = (1 << (x + 1)); int m = (1 << (y + 1)); vector f(n, vl(m)); f[0][0] = f[0][1] = f[1][0] = f[n - 1][0] = f[0][m - 1] = 1; vector g(n, vl(m)); g[a][b] = g[n - a][m - b] = 1; g[n - a][b] = g[a][m - b] = mod - 1; ntt2d(f); ntt2d(g); for(int i = 0; i < n; i ++) for(int j = 0; j < m; j ++) { g[i][j] *= qpow(f[i][j], t); g[i][j] %= mod; } ntt2dinv(g); cout << g[c][d] << '\n'; }