There are n squares drawn from left to right on the floor. The i-th square has three integers p_i,a_i,b_i, written on it. The sequence p_1,p_2,...,p_n forms a permutation.

Each round you will start from the leftmost square 1 and jump to the right. If you are now on the i-th square, you can do one of the following two operations:

  1. Jump to the i+1-th square and pay the cost a_i. If i=n, then you can end the round and pay the cost a_i. 
  2. Jump to the j-th square and pay the cost b_i, where j is the leftmost square that satisfies j > i, p_j > p_i. If there is no such j then you can end the round and pay the cost b_i. 



There are q rounds in the game. To make the game more difficult, you need to maintain a square set S (initially it is empty). You must pass through these squares during the round (other squares can also be passed through). The square set S for the i-th round is obtained by adding or removing a square from the square set for the (i-1)-th round. 

For each round find the minimum cost you should pay to end it.

Input

The first line contains two integers n, q (1≤ n,q≤ 2 ⋅ 10^5) — the number of squares and the number of rounds.

The second line contains n distinct integers p_1,p_2,...,p_n (1≤ p_i≤ n). It is guaranteed that the sequence p_1,p_2,...,p_n forms a permutation.

The third line contains n integers a_1,a_2,…,a_n (-10^9≤ a_i≤ 10^9).

The fourth line contains n integers b_1,b_2,...,b_n (-10^9≤ b_i≤ 10^9).

Then q lines follow, i-th of them contains a single integer x_i (1≤ x_i≤ n). If x_i was in the set S on the (i-1)-th round you should remove it, otherwise, you should add it.

Output

Print q lines, each of them should contain a single integer — the minimum cost you should pay to end the corresponding round.

Examples

Input


3 2
2 1 3
10 -5 4
3 -2 3
1
2


Output


6
8


Input


5 4
2 1 5 3 4
6 -5 3 -10 -1
0 3 2 7 2
1
2
3
2


Output


-8
-7
-7
-8

Note

Let's consider the character T as the end of a round. Then we can draw two graphs for the first and the second test.

<image> <image>

In the first round of the first test, the set that you must pass through is \{1\}. The path you can use is 1→ 3→ T and its cost is 6.

In the second round of the first test, the set that you must pass through is \{1,2\}. The path you can use is 1→ 2→ 3→ T and its cost is 8.
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <algorithm>

#define PB push_back

using namespace std;

const int N = 2e5 + 500;
const int OFF = (1 << 18);

typedef long long ll;

ll T[2 * OFF][2]; 
int T_m[2 * OFF], P[N], A[N], B[N];

void update(int i, int a, int b, int lo, int hi, ll x, int k){
	if(lo <= a && b <= hi){
		T[i][k] += x; return;
	}
	if(a > hi || b < lo) return;
	update(2 * i, a, (a + b) / 2, lo, hi, x, k);
	update(2 * i + 1, (a + b) / 2 + 1, b, lo, hi, x, k);
}

ll get(int x, int k){
	ll ret = 0;
	for(x = (x + OFF) ; x ; x /= 2)
		ret += T[x][k];
	return ret;
}

int mrg(int i, int j){
	if(P[i] > P[j])
		return i;
	return j;
}

int query(int i, int a, int b, int lo, int hi){
	if(lo <= a && b <= hi) return T_m[i];
	if(a > hi || b < lo) return N - 1;
	return mrg(query(2 * i, a, (a + b) / 2, lo, hi), query(2 * i + 1, (a + b) / 2 + 1, b, lo, hi));
}

vector < int > gdj[N];
vector < int > dod[N], odu[N];
int qL[3 * N], qR[3 * N];
int n, q, qq;
ll qS[3 * N];

void solve(int l, int r){
	if(l > r) return;
	int mid = query(1, 0, OFF - 1, l, r);
	solve(l, mid - 1); solve(mid + 1, r);
	update(1, 0, OFF - 1, mid + 1, r, A[mid], 0);
	for(int x : gdj[mid])
		qS[x] = get(qL[x], 1) + get(qR[x], 0);
	update(1, 0, OFF - 1, mid, r, (l != mid ? get(l, 1) : 0), 0);
	update(1, 0, OFF - 1, l, mid, min((r != mid ? get(mid + 1, 1) : 0LL) + A[mid], (ll)B[mid]), 1);
}

inline int dodaj_kverij(int l, int r){
	qL[qq] = l, qR[qq] = r; 
	gdj[query(1, 0, OFF - 1, l, r)].PB(qq);
	return qq++;
}

int main(){
	scanf("%d%d", &n, &q);
	for(int i = 0;i < n;i++)	
		scanf("%d", P + i), T_m[OFF + i] = i;
	P[n] = n; T_m[OFF + n] = n;
	for(int i = OFF - 1 ; i ; i--)
		T_m[i] = mrg(T_m[2 * i], T_m[2 * i + 1]);
	for(int i = 0;i < n;i++)
		scanf("%d", A + i);
	for(int i = 0;i < n;i++)
		scanf("%d", B + i);
	set < int > S; S.insert(0); S.insert(n);
	int st = dodaj_kverij(0, n);	
	for(int i = 0;i < q;i++){
		int x; scanf("%d", &x); x--;
		if(!x) continue;
		if(S.count(x)){
			S.erase(x);
			int pos = *S.lower_bound(x), pri = *(--S.lower_bound(x));
			odu[i].PB(dodaj_kverij(pri, x));
			odu[i].PB(dodaj_kverij(x, pos));
			dod[i].PB(dodaj_kverij(pri, pos));
		}
		else{
			int pos = *S.lower_bound(x), pri = *(--S.lower_bound(x));
			S.insert(x);
			odu[i].PB(dodaj_kverij(pri, pos));
			dod[i].PB(dodaj_kverij(pri, x));
			dod[i].PB(dodaj_kverij(x, pos));
		}
	}
	solve(0, n);
	ll cur = qS[st];
	for(int i = 0;i < q;i++){
		for(int x : odu[i]) cur -= qS[x];
		for(int x : dod[i]) cur += qS[x];
		printf("%lld\n", cur);
	}
	return 0;
}

