#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; template struct SegTree{ using FX=function; int n; FX fx; const X ex; vector dat; SegTree(int n_,FX fx_,X ex_) : n(),fx(fx_),ex(ex_),dat(n_*4,ex_){ int x=1; while (n_>x){ x *= 2; } n=x; } void set(int i,X x){ dat[i+n-1]=x;} void build(){ for (int k=n-2;k>=0;k--) dat[k]=fx(dat[2*k+1],dat[2*k+2]); } void update(int i,X x){ i += n-1; dat[i]=x; while(i>0){ i=(i-1)/2; dat[i]=fx(dat[i*2+1],dat[i*2+2]); } } X get(int i){return dat[i+n-1];} X all(){return dat[0];} X query(int a,int b){ return query_sub(a,b,0,0,n);} X query_sub(int a,int b,int k,int l,int r){ if(r<=a || b<=l){ return ex; }else if(a<=l && r<=b){ return dat[k]; }else{ X vl=query_sub(a,b,k*2+1,l,(l+r)/2); X vr=query_sub(a,b,k*2+2,(l+r)/2,r); return fx(vl,vr); } } }; const int MOD=998244353; ll modpow(ll x,ll n){ x%=MOD; ll ans=1; while(n){ if(n&1) ans=ans*x%MOD; x=x*x%MOD; n/=2; } return ans; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int h,w,n,p; cin>>h>>w>>n>>p; vector> P; rep(i,n){ int x,y; cin>>x>>y; x--,y--; P.push_back({x,y}); } sort(ALL(P)); using X=int; auto fx=[](X x1,X x2)->X{ return max(x1,x2);}; X ex=0; SegTree seg(w,fx,ex); rep(i,n){ int x=P[i].first,y=P[i].second; seg.update(y,seg.query(0,y+1)+1); } ll a=seg.all(),b=h+w-3-a; cout<<(1-modpow(p-2,a)*modpow(p-1,b)%MOD*modpow(modpow(p,h+w-3),MOD-2)%MOD+MOD)%MOD<