ll@(h,w,k,m),hw=h*w; unionFind u[hw+1]; rep(i,hw+1){ u[i].malloc(hw,1); } mint().setmod(m); mint a,z,c[hw+1],e[hw+1]; rep(i,hw){ a+=mint(1)/(i+1); } rep(i,hw+1){ c[i]=mint(i)**k; } rep(b,1,1<