def add(x,y): return x + y def e(a): if a == min: return 10**18 if a == max: return -10**18 if a == add: return 0 class SegTree: def __init__(self, segf, init_val): n = len(init_val) self.segf = segf self.e = e(segf) self.seg_len = 1 << n.bit_length() self.seg = [self.e] * 2*self.seg_len for i in range(n): self.seg[i+ self.seg_len] = init_val[i] for i in range(self.seg_len)[::-1]: self.seg[i] = segf(self.seg[i<<1], self.seg[i<<1|1]) def point_add(self,pos,x): pos += self.seg_len self.seg[pos] += x while True: pos >>= 1 if not pos: break self.seg[pos] = self.segf(self.seg[pos<<1], self.seg[pos<<1|1]) def point_update(self, pos, x): pos += self.seg_len self.seg[pos] = x while True: pos >>= 1 if not pos: break self.seg[pos] = self.segf(self.seg[pos<<1], self.seg[pos<<1|1]) def get_range(self,l,r): l += self.seg_len; r += self.seg_len res = self.e while l < r: if l & 1: res = self.segf(res, self.seg[l]) l += 1 if r & 1: r -= 1 res = self.segf(res, self.seg[r]) l >>= 1; r >>= 1 return res # ------ range_add & get_point ------- def range_add(self, l,r,x): l += self.seg_len; r += self.seg_len self.seg[l] += x self.seg[r] += x while l < r: if l & 1: self.seg[l] = self.segf(x,self.seg[l]) l += 1 if r & 1: r -= 1 self.seg[r] = self.segf(x,self.seg[r]) l >>= 1; r >>= 1 def get_point(self,pos): pos += self.seg_len res = self.seg[pos] while True: pos >>=1 if not pos: break res = self.segf(res, self.seg[pos]) return res mod = 998244353 h,w,n,p = map(int,input().split()) xy = [list(map(int,input().split())) for i in range(n)] xx = [[] for i in range(h+1)] for x,y in xy: xx[x].append(y) for i in range(1, h+1): xx[i].sort(key = lambda x : -x) st = SegTree(max, [0]*(w+1)) for i in range(1, h+1): xxi = xx[i] for y in xxi: tmp = st.get_range(0, y+1) tmp += 1 st.point_update(y, tmp) cnt = st.get_range(0, w+1) ex1 = (p-1)*pow(p, mod-2, mod) ex2 = (p-2)*pow(p, mod-2, mod) ans = 1 - pow(ex1, h+w-1-cnt-2, mod) * pow(ex2, cnt, mod)%mod ans %= mod print(ans)