n = int(eval(input()))

a = [int(i) for i in input().split()]

b = [int(i) for i in input().split()]

c = [int(i) for i in input().split()]

a_sp = [c[a[i] - 1] for i in range(n - 1) if a[i + 1] - a[i] == 1]

print((sum(b + a_sp)))
n = int(eval(input()))

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

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

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

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

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

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