import bisect H, W, N, P = map(int, input().split()) good = [] for _ in range(N): x, y = map(int, input().split()) good.append((x, y)) # Sort good cells by x ascending, then y ascending good.sort(key=lambda x: (x[0], x[1])) # Extract y-coordinates and compute the length of the longest non-decreasing subsequence ys = [y for x, y in good] tails = [] for num in ys: idx = bisect.bisect_right(tails, num) if idx == len(tails): tails.append(num) else: tails[idx] = num k = len(tails) total = H + W - 3 mod = 998244353 if total < k: k = total # This should not happen as per problem constraints term1 = pow(P - 2, k, mod) term2 = pow(P - 1, total - k, mod) numerator = (term1 * term2) % mod denominator = pow(P, total, mod) denominator_inv = pow(denominator, mod - 2, mod) product = (numerator * denominator_inv) % mod result = (1 - product) % mod print(result)