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