#include using namespace std; #include using namespace atcoder; using mint=modint998244353; //1000000007; using ll=long long; using pp=pair; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int op(int a,int b){return max(a,b);} int e(){return -1e8;} int main(){ int h,w,n,p;cin>>h>>w>>n>>p; map>m; rep(i,n){ int a,b; cin>>a>>b; a--;b--; m[a].pb(b); } for(auto&[z,a]:m)sort(all(a)); segtreesg(w); sg.set(0,0); for(auto [z,v]:m){ for(auto x:v){ int a=sg.prod(0,x+1); sg.set(x,a+1); } } int ax=sg.prod(0,w+1); mint t=2; t/=p; mint ans=t.pow(ax); t/=2; ans*=t.pow(h+w-2-ax); cout<