Buggy python submission (verdict: Runtime Error):
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]]
sum = sum + l[1][n-1]
print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][i]
sum = sum + l[1][n]
print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
sum = 0
n = int(input())
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][i]
sum = sum + l[1][n]
print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
sum = 0
n = int(input())
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][i]
sum = sum + l[1][n]
print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
sum = 0
n = int(input())
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n):
  sum += l[1][i]
  if l[0][i+1] == l[0][i]+1:
    sum += l[2][i]

print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
sum = 0
n = input()
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n):
  sum += l[1][i]
  if l[0][i+1] == l[0][i]+1:
    sum += l[2][i]

print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)

Buggy python submission (verdict: Runtime Error):
sum = 0
n = input()
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n):
  sum += l[1][i]
  if l[0][i] == l[0][i+1]:
    sum += l[2][i]

print(sum)

Fixed submission:
sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)