n=int(eval(input()))

a=list(map(int,input().split()))

b=list(map(int,input().split()))

c=list(map(int,input().split()))



ans=0

b_n=-2

for i in range(n):

  num=a[i]-1

  ans+=b[num]

  if num==b_n+1:

    ans+=c[b_n]

  b_n=a[i]-1

print(ans)
n=int(eval(input()))

a=list(map(int,input().split()))

b=list(map(int,input().split()))

c=list(map(int,input().split()))



ans=sum(b)

for i in range(n-1):

  if a[i+1]==a[i]+1:

    ans+=c[a[i]-1]

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
b_n = -2
for i in range(n):
    num = a[i] - 1
    ans += b[num]
    if num == b_n + 1:
        ans += c[b_n]
    b_n = a[i] - 1
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = sum(b)
for i in range(n - 1):
    if a[i + 1] == a[i] + 1:
        ans += c[a[i] - 1]
print(ans)

-ans = 0 -b_n = -2 -for i in range(n): -    num = a[i] - 1 -    ans += b[num] -    if num == b_n + 1: -        ans += c[b_n] -    b_n = a[i] - 1 +ans = sum(b) +for i in range(n - 1): +    if a[i + 1] == a[i] + 1: +        ans += c[a[i] - 1]