from collections import defaultdict class Segtree(): def __init__(self): self.tree = [-1 * 10 ** 9 for _ in range(1 << 19)] def set(self, n, k): n += (1 << 18) ret = -1 * (10 ** 9) now = n self.tree[now] = k while now > 1: now = now // 2 self.tree[now] = max(self.tree[now * 2], self.tree[now * 2 + 1]) def out(self, x): print(self.tree[(1 << 18) : (1 << 18) + x]) def get(self, n): return self.tree[n + (1 << 18)] def prod(self, l, r): l += (1 << 18) r += (1 << 18) if l >= r: return -1 * (10 ** 9) left_ret = -1 * (10 ** 9) right_ret = -1 * (10 ** 9) while l < r: if l % 2 == 1: left_ret = max(left_ret, self.tree[l]) l += 1 if r % 2 == 1: r -= 1 right_ret = max(right_ret, self.tree[r]) l = l // 2 r = r // 2 return max(left_ret, right_ret) H, W, N, P = map(int, input().split()) sy = set() sy.add(1) plst = [] for i in range(N): x, y = map(int, input().split()) sy.add(y) plst.append([x, y]) plst.sort() #print(plst) ly = list(sy) ly.sort() #print(ly) d = defaultdict(int) for i in range(len(ly)): d[ly[i]] = i seg = Segtree() seg.set(d[1], 0) for i in range(N): vy = d[plst[i][1]] val = seg.get(vy) prd = seg.prod(0, vy + 1) seg.set(vy, max(prd, val) + 1) max_omen = seg.prod(0, (1 << 18)) mod = 998244353 def inv(p): return pow(p, mod - 2, mod) ans = 1 ans = (ans * pow(P - 1, H + W - 3 - max_omen, mod)) % mod ans = (ans * pow(P - 2, max_omen, mod)) % mod ans = (pow(P, H + W - 3, mod) - ans + mod) % mod ans = (ans * inv(pow(P, H + W - 3, mod))) % mod print(ans)