#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> b(n);
  for (int i = 0; i < n; i++) cin >> b[i];
  vector<int> c(n - 1);
  for (int i = 0; i < n - 1; i++) cin >> c[i];
  for (int i = 0; i < n; i++) a[i]--;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cout << count << endl;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] + 1 == a[i + 1]) {
      count += c[a[i]];
    }
  }
  cout << count << endl;
  return 0;
}
