n;m; a[11111]; b[11111]; c[11111]; d; x;y; main(i,j){ scanf("%d",&n); for(i=1;i<=n;++i){ scanf("%d%d",&a[i],&b[i]); } scanf("%d",&m); for(j=1;j<=m;++j){ scanf("%d%d",&x,&y); for(i=1;i<=n;++i){ if(x<=a[i]&&y>=b[i]){ ++c[j]; } } if(d