P = 998244353 m,n,S = map(int,input().split()) pa = m * pow(n,P-2,P) % P qa = (1 - pa) % P m,n,T = map(int,input().split()) pb = m * pow(n,P-2,P) % P qb = (1 - pb) % P K = int(input()) C = 205 SA = [0] * C SB = [0] * C now = qa SA[0] = qa for i in range(1,C): now = now * pa % P SA[i] = now now = qb SB[0] = now for i in range(1,C): now = now * pb % P SB[i] = now n = S + T + 1 def seki(x,y): l = [[0] * n for _ in range(n)] for i in range(n): for j in range(n): for k in range(n): l[i][j] = (l[i][j] + x[i][k] * y[k][j]) % P return l e = [[0] * n for _ in range(n)] for i in range(n): e[i][i] = 1 R = [[0] * n for _ in range(n)] for j in range(-T,S+1): for i in range(-T,S+1): if i == S: if j != S:continue R[S-j][S-i] = 1 continue if i == -T: if j != -T:continue R[S-j][S-i] = 1 continue if j == S: tmp = pow(pa,S - i,P) R[S-j][S-i] = tmp continue if j == -T: tmp = 0 for k in range(i,S): tmp += SA[k-i] * pow(pb,k-j,P) % P tmp %= P R[S-j][S-i] = tmp continue else: delta = max(i,j) tmp = 0 for k in range(delta,S): tmp += SA[k-i] * SB[k - j] % P tmp %= P R[S-j][S-i] = tmp while K: if K & 1: e = seki(e,R) R = seki(R,R) K >>= 1 a = e[0][S] b = e[-1][S] print(a) print(b)