import java.util.*; public class Main { final static long md = 998244353; final static long root = 3; final static long w[] = new long[1 << 17]; final static long iw[] = new long[1 << 17]; static void ntt(int n, long[] a) { for (int m = n / 2; m > 0; m /= 2) { for (int s = 0, k = 0; s < n; s += 2 * m, k++) { for (int i = s; i < s + m; i++) { long x = a[i], y = a[i + m] * w[k] % md; a[i] = (x + y >= md ? x + y - md : x + y); a[i + m] = (x - y < 0 ? x + md - y : x - y); } } } } static void intt(int n, long[] a) { for (int m = 1; m < n; m *= 2) { for (int s = 0, k = 0; s < n; s += 2 * m, k++) { for (int i = s; i < s + m; i++) { long x = a[i], y = a[i + m]; a[i] = (x + y >= md ? x + y - md : x + y); a[i + m] = (x - y + md) * iw[k] % md; } } } } static long power(long x, long n) { if (n == -1) { n = md - 2; } x %= md; long ans = 1; long tmp = x; while (n > 0) { if ((n & 1) == 1) { ans = ans * tmp % md; } tmp = tmp * tmp % md; n /= 2; } return ans; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int X = sc.nextInt(); final int Y = sc.nextInt(); final long T = (sc.nextLong() - 1) % (md - 1) + 1; final int a = sc.nextInt(); final int b = sc.nextInt(); final int c = sc.nextInt(); final int d = sc.nextInt(); final int H = 1 << (X + 1); final int W = 1 << (Y + 1); final long dp[][] = new long[H][W]; final long trans[][] = new long[H][W]; dp[a][b] = 1; dp[a][W - b] = -1; dp[H - a][b] = -1; dp[H - a][W - b] = 1; trans[0][0] = trans[0][1] = trans[1][0] = trans[H - 1][0] = trans[0][W - 1] = 1; w[0] = iw[0] = 1; for (int m = 1; m < 1 << 17; m *= 2) { long dw = power(root, (md - 1) / (4 * m)); long dwinv = power(dw, -1); for (int i = 0; i < m; i++) { w[m + i] = w[i] * dw % md; iw[m + i] = iw[i] * dwinv % md; } } for (int i = 0; i < H; i++) { ntt(W, dp[i]); ntt(W, trans[i]); } final long dpv[] = new long[H]; final long transv[] = new long[H]; for (int j = 0; j < W; j++) { for (int i = 0; i < H; i++) { dpv[i] = dp[i][j]; transv[i] = trans[i][j]; } ntt(H, dpv); ntt(H, transv); for (int i = 0; i < H; i++) { dp[i][j] = dpv[i]; trans[i][j] = transv[i]; } } for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { dp[i][j] = dp[i][j] * power(trans[i][j], T) % md; } intt(W, dp[i]); } for (int i = 0; i < H; i++) { dpv[i] = dp[i][d]; } intt(H, dpv); System.out.println(dpv[c] * power(H * W, -1) % md); } }