#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N, 0);
  vector<int> B(N, 0);
  vector<int> C(N - 1, 0);
  for (int i = 0; i < N; ++i) cin >> A[i];
  for (int i = 0; i < N; ++i) cin >> B[i];
  for (int i = 0; i < N - 1; ++i) cin >> C[i];
  int ans = 0;
  for (int i = 0; i < N - 1; ++i) {
    ans += B[A[i] - 1];
    cout << ans << endl;
    if (A[i + 1] - A[i] == 1) ans += C[A[i] - 1];
  }
  cout << ans << endl;
  ans += B[A[N - 1] - 1];
  cout << ans << endl;
}
