N = int(eval(input()))

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

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

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



before = -99

points = 0

for i in li_a:

      points += li_b[i - 1]

      if before + 1 == i:

            points += li_c[i - 2]

      before = i

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

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

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

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



s=sum(b)

add_s=0

for i in range(n-1):

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

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

print((s+add_s))
N = int(eval(input()))
li_a = list(map(int, input().split()))
li_b = list(map(int, input().split()))
li_c = list(map(int, input().split()))
before = -99
points = 0
for i in li_a:
    points += li_b[i - 1]
    if before + 1 == i:
        points += li_c[i - 2]
    before = i
print(points)

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

-N = int(eval(input())) -li_a = list(map(int, input().split())) -li_b = list(map(int, input().split())) -li_c = list(map(int, input().split())) -before = -99 -points = 0 -for i in li_a: -    points += li_b[i - 1] -    if before + 1 == i: -        points += li_c[i - 2] -    before = i -print(points) +n = int(eval(input())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) +c = list(map(int, input().split())) +s = sum(b) +add_s = 0 +for i in range(n - 1): +    if a[i] == a[i + 1] - 1: +        add_s += c[a[i] - 1] +print((s + add_s))