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