#include<cstdio>
using namespace std;
int n,num,maxn,say;
int ans[10001];
bool visit[10001][10001];
int main(){
freopen("tallest.in","r",stdin);
freopen("tallest.out","w",stdout);
scanf("%d%d%d%d",&n,&num,&maxn,&say);
for(short int i=1;i<=n;i++)ans[i]=maxn;
for(short int i=1;i<=say;i++){
short int a,b;
scanf("%hd%hd",&a,&b);
if(a>b){b^=a;a^=b;b^=a;}
if(visit[a][b])continue;
visit[a][b]=true;
for(short int j=a+1;j<b;j++)ans[j]--;
}
for(short int i=1;i<=n;i++)
printf("%d\n",ans[i]);
return 0;
}