s[99],k[101];w,p,q,i,x,y,t;main(h){for(scanf("%d%d%*d",&w,&h);~scanf("%d%d",&p,&q);x+=!!p,y+=!!q,s[t]=p,k[t++]=q)for(i=0;i