#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; using ll = long long; template using vec = vector; template using vvec = vector>; template bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;} template bool chmax(T& a,T b){if(a=0;i--) #define all(x) (x).begin(),(x).end() #define debug(x) cerr << #x << " = " << (x) << endl; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N,Q; cin >> N >> Q; vec A(N); rep(i,N) cin >> A[i]; vec cnt(N); rep(i,Q){ int r; cin >> r; cnt[r]++; } vec B(N); rep(i,N) if(cnt[i]){ rep(j,N){ int t = i+j>=N? i+j-N:i+j; B[j] += cnt[i]*A[t]; } } rep(i,N) cout << B[i] << (i!=N-1? " ":"\n"); }