I-Will-Windra has entered a racing contest! The racetrack can be represented as two arrays of integers aa and bb, both of length nn. When I-Will-Windra is at position ii, they can jump a[i]a[i] positions to the left or right, assuming it is within the bounds of the array. Furthermore, this move costs them b[i]b[i].

As I-Will-Windra's FIT2004 tutor, you want to help them. Given starting positions xx and yy, what is the minimum cost by which I-Will-Windra can get from xx to yy? If this is not possible, output -1 instead.

Input

The first line of input will consist of three integers, xx yy and zz.

The next two lines will each consist of nn integers, representing aa and bb respectively.

Output

The output should consist of a single integer, the minimum cost or -1 if it is impossible.

Constraints

  • 2≤n≤1052 \le n \le 10^5
  • 0≤x,y≤n−10 \le x,y \le n-1
  • 1≤a[i]≤n1 \le a[i] \le n
  • 1≤b[i]≤301 \le b[i] \le 30

Example 1

Input 1
5 4 2
3 3 1 3 2
533 776 812 489 523
Output 1
523
Explanation

This can be completed in one jump, from index 4 to index 2 (of cost 523).

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.