K,N,M=map(int,input().split()) a=list(map(int,input().split())) c=list(map(int,input().split())) mod=10**9+7 seq=a+[0]*(N-K) for i in range(K,N): seq[i]=sum(c[j]*seq[i-1-j] for j in range(K)) seq[i]%=mod end_data=[[0 for i in range(K)] for j in range(N)] for i in range(K,N): end_data[i][0]=seq[i] for i in range(N-2,K-1,-1): for j in range(1,K): end_data[i][j]=(end_data[i+1][j-1]-c[j-1]*seq[i])%mod first=[a[i] for i in range(K)] for i in range(1,K): minus=sum(a[j]*c[i-1-j] for j in range(i)) first[i]-=minus first[i]%=mod check=[first[i] for i in range(K)] for i in range(1,K): check[i]+=sum(c[j]*check[i-1-j] for j in range(i)) check[i]%=mod x=[0]*(N+K+1) too_short=[0]*N for _ in range(M): l,r=map(int,input().split()) if r-l>=K: for i in range(l,l+K): x[i]+=first[i-l] x[i]%=mod if r-l!=N: for i in range(r,r+K): x[i]+=-end_data[r-l][i-r] x[i]%=mod else: for i in range(l,r): too_short[i]+=a[i-l] too_short[i]%=mod for i in range(N): x[i]+=sum(c[j]*x[i-1-j] for j in range(min(K,i))) x[i]%=mod for i in range(N): print((x[i]+too_short[i])%mod)