n = int(eval(input()))

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

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

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

check = 0

for i in range(n):

    tabe = a[i]

    check += b[tabe - 1]

    if i < n -1 :

        if (a[i+1] - a[i]) == 1:

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

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

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

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

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



ans = 0

for i in range(n):

    ans += b[i]

    if i == 0:continue

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

        ans += c[a[i-1]-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()))
check = 0
for i in range(n):
    tabe = a[i]
    check += b[tabe - 1]
    if i < n - 1:
        if (a[i + 1] - a[i]) == 1:
            check += c[a[i] - 1]
print(check)

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

-check = 0 +ans = 0 -    tabe = a[i] -    check += b[tabe - 1] -    if i < n - 1: -        if (a[i + 1] - a[i]) == 1: -            check += c[a[i] - 1] -print(check) +    ans += b[i] +    if i == 0: +        continue +    if a[i] - a[i - 1] == 1: +        ans += c[a[i - 1] - 1] +print(ans)