#include #include #include using namespace std; using ll = long long; using mint = atcoder::modint998244353; int op(int a, int b) { return max(a, b); } int e() { return 0; } int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int H, W, N, P; cin >> H >> W >> N >> P; vector> I(N); for(auto&[x, y]: I) cin >> x >> y; sort(I.begin(), I.end()); const int M = 2e5 + 10; atcoder::segtree seg(M); for(int i = 0; i < N; i++) { const auto&[x, y] = I[i]; seg.set(y, seg.prod(0, y + 1) + 1); } int cnt = seg.all_prod(); mint ans = 1; const mint invP = mint::raw(P).inv(); ans *= (1 - invP * 2).pow(cnt); ans *= (1 - invP).pow(H + W - 3 - cnt); ans = 1 - ans; cout << ans.val() << endl; }