#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, x, S = 0, D = 0, E;
  cin >> N;
  int A[20];
  int B[20];
  int C[20];
  int K[20];
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
  }
  for (int i = 1; i <= N; i++) {
    cin >> B[i];
  }
  for (int i = 1; i < N; i++) {
    cin >> C[A[i]];
  }
  C[A[N]] = 0;
  for (int i = 1; i < N; i++) {
    cout << C[i] << endl;
  }
  C[N + 1] = 0;
  for (int i = 1; i <= N; i++) {
    S += B[A[i]];
  }
  for (int i = 1; i <= N; i++) {
    D += C[A[i + 1]];
  }
  E = S + D;
  cout << E << endl;
}
