#include <bits/stdc++.h>
using std::cin;
using std::cout;
using LL = unsigned int;
using ull = unsigned long long;
using ld = long double;
inline int read() {
int x = 0;
char c = getchar();
for (; c < '0' || c > '9'; c = getchar());
for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + (c ^ 48), c = getchar());
return x;
}
const int maxn = 1e6 + 10;
inline int lowbit(int x) {
return (-x) & x;
}
int n,m,k;
LL a[maxn],t[maxn];
void modi(int pos,LL val) {
for(int i=pos; i<=n; i+=lowbit(i)) {
t[i]+=val-a[pos];
}
a[pos]=val;
}
LL sum(int pos) {
LL ans=0;
for(int i=pos; i; i-=lowbit(i)) {
ans+=t[i];
}
return ans;
}
int u[maxn],d[maxn];
int l[maxn],r[maxn];
std::vector<int> x,y;
struct Tree {
int x,y;
bool operator<(const Tree& b) const {
if(x==b.x) return y<b.y;
return x<b.x;
}
} tr[maxn];
LL c[maxn][14],ans;
void init() {
c[1][0]=c[1][1]=1;
LL top = std::max(m,n);
for(int i=2; i<=top; i++) {
c[i][0]=1;
for(int j=1; j<=k; j++) {
c[i][j]=c[i-1][j-1]+c[i-1][j];
}
}
}
signed main() {
int nn=read(),mm=read();
int q=read();
for(int i=1; i<=q; i++) {
tr[i].x=read(),tr[i].y=read();
x.push_back(tr[i].x);
y.push_back(tr[i].y);
}
std::sort(x.begin(),x.end());
std::sort(y.begin(),y.end());
x.erase(std::unique(x.begin(),x.end()),x.end());
y.erase(std::unique(y.begin(),y.end()),y.end());
n=x.size(),m=y.size();
k=read();
init();
for(int i=1; i<=q; i++) {
tr[i].x=std::lower_bound(x.begin(),x.end(),tr[i].x)-x.begin()+1;
tr[i].y=std::lower_bound(y.begin(),y.end(),tr[i].y)-y.begin()+1;
r[tr[i].x]++,d[tr[i].y]++;
}
std::sort(tr+1,tr+1+q);
int px=0,py=0;
for(int i=1; i<=q; i++) {
int x=tr[i].x,y=tr[i].y;
if(px==x) {
ans += c[l[px]][k]*c[r[px]][k] * (sum(y-1)-sum(py));
}
u[y]++,d[y]--;
l[x]++,r[x]--;
modi(y,c[u[y]][k]*c[d[y]][k]);
px=x,py=y;
}
if(ans >= 2147483648)ans -= 2147483648;
cout << ans;
return 0;
}