#include #include using namespace std; using namespace atcoder; #define rep(i,n)for (int i = 0; i < int(n); ++i) #define rrep(i,n)for (int i = int(n)-1; i >= 0; --i) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() template void chmax(T& a, const T& b) {a = max(a, b);} template void chmin(T& a, const T& b) {a = min(a, b);} using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; using mint = modint998244353; struct mat: std::vector> { mat(int n=0): std::vector>::vector(n, vector(n)) {} friend mat operator*(const mat& lhs, const mat& rhs) { const int n = lhs.size(); mat ret(n); for(int i = 0; i < n; i++) for(int k = 0; k < n; k++) for(int j = 0; j < n; j++) { ret[i][j] += lhs[i][k] * rhs[k][j]; } return ret; } mat& operator*=(const mat& rhs) { return (*this) = (*this) * rhs; } mat pow(unsigned long long n) { mat A = *this; mat res = mat::I(A.size()); for(; n; n >>= 1) { if (n & 1) res *= A; A *= A; } return res; } static mat I(int n) { mat ret(n); for(int i = 0; i < n; i++) ret[i][i] = mint::raw(1); return ret; } }; int main() { ios::sync_with_stdio(false); cin.tie(0); int ma, na, s, mb, nb, t; cin >> ma >> na >> s >> mb >> nb >> t; mint p = mint(ma) / na, q = mint(mb) / nb; mat A(s + t + 1), B(s + t + 1); A[0][0] = 1; A[s+t][s+t] = 1; for(int i = 1; i < s + t; i++) { mint now = 1; for(int j = i; j < s + t; j++) { A[i][j] = now * (1 - p); now *= p; } A[i][s + t] = now; } B[0][0] = 1; B[s+t][s+t] = 1; for(int i = 1; i < s + t; i++) { mint now = 1; for(int j = i; j > 0; j--) { B[i][j] = now * (1 - q); now *= q; } B[i][0] = now; } ll k; cin >> k; mat X = (A * B).pow(k); mint ans1 = X[t][s + t], ans2 = X[t][0]; cout << ans1.val() << '\n' << ans2.val() << '\n'; }