#include<bits/stdc++.h>
using namespace std;
int N,I,H,R;
int a[10010];
bool st[10010][10010];
int main(){
scanf("%d%d%d%d",&N,&I,&H,&R);
a[0]=H;
while(R--){
int x,y;scanf("%d%d",&x,&y);
if(x>y) swap(x,y);
if(st[x][y]) continue;
st[x][y]=true;
a[x+1]--;
a[y]++;
}
int sum=a[0];
for(int i=1;i<=N;i++){
sum+=a[i];
printf("%d\n",sum);
}
return 0;
}