mod = 1000000007 eps = 10**-9 mask = (1 << 30) - 1 def main(): import sys input = sys.stdin.readline N, Q = map(int, input().split()) A = list(map(int, input().split())) R = list(map(int, input().split())) B = [0] * N for r in R: B[r] += 1 S = 0 for a in A: S <<= 30 S += a ans = 0 C = [0] * N for i in range(N-1, -1, -1): ans += S * B[(N - i)%N] C[(i+N-1)%N] = ans & mask ans >>= 30 for i in range(N-2, -1, -1): C[i] += ans & mask ans >>= 30 print(*C) if __name__ == '__main__': main()