#include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0;i<(n);i++) int main(){ int N,Q; cin>>N>>Q; int A[200000]; rep(i,N) cin>>A[i]; rep(i,N) A[i+N]=A[i]; int R[200000]; rep(i,Q) cin>>R[i]; vector ans(N); rep(j,Q){ rep(i,N) ans[i]+=A[R[j]+i]; } rep(i,N){ if(i) cout<<" "; cout<