#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  int i, sat, d, e;
  cin >> n;
  e = -2;
  long long a[n], b[n], c[n];
  sat = 0;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  for (i = 1; i < n; i++) cin >> c[i];
  for (i = 1; i <= n; i++) {
    d = a[i];
    sat = sat + b[d];
    if (d - e == 1) {
      sat = sat + c[d - 1];
    }
    e = d;
    cout << sat << " ";
  }
  cout << sat;
}
