long mod=1e9+7,dp[3002][3002],W; L[3000],R[3000],i,j; main(n,m,k){ scanf("%d%d%d",&n,&m,&k); for(dp[0][1]=1;~scanf("%d%d",L+j++,R+j);); for(;i