Problem: 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.

Solution (in CPP):

Solution:
//CLOCKS_PER_SEC
using namespace std;
#include<bits/stdc++.h>
#define sqr(x) 1ll*(x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while (((c=getchar())==' ')||c=='\n');x=c;}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define si set<int>
#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define rep0(i,x) forup ((i),0,((int)(x))-1)
#define rep0d(i,x) fordo ((i),((int)(x))-1,0)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x2bbbbbbbbbbbbbbbll
//#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
int n,m,i,j,p[200005],a[200005],b[200005],fa[200005],tp[200005],sz[200005],son[200005],stk[200005],stp;
int vis[200005],cnt[200005];
long long val[200005],dis[200005],ans;
vector<int> e[200005];
set<int> s;
void dfs1(int x,int fa)
{
	son[x]=-1;::fa[x]=fa;sz[x]=1;
	fe(it,e[x])if(*it!=fa){
		dfs1(*it,x);
		sz[x]+=sz[*it];
		if(son[x]==-1||sz[son[x]]<sz[*it]){
			son[x]=*it;
		} 
	}
}
void dfs2(int x,int t)
{
	tp[x]=t;
	if(son[x]!=-1){
		dfs2(son[x],t);
	}
	fe(it,e[x])if(*it!=fa[x]&&*it!=son[x]){
		dfs2(*it,*it);
	}
}
int lca(int x,int y)
{
	while(tp[x]!=tp[y]){
		if(tp[x]<tp[y]) swap(x,y);
		x=fa[tp[x]];
	}
	return min(x,y);
}
long long gdis(int x,int y)
{
	return dis[x]+dis[y]-2*dis[lca(x,y)];
}
void ins(int x)
{
	int l,r;
	set<int>::iterator it=s.lower_bound(x);
	if(it==s.end()) r=*s.begin(); else r=*it;
	it--;l=*it;
	ans+=gdis(l,x)+gdis(x,r)-gdis(l,r);
	s.insert(x); 
}
void del(int x)
{
	int l,r;
	s.erase(x);
	set<int>::iterator it=s.lower_bound(x);
	if(it==s.end()) r=*s.begin(); else r=*it;
	it--;l=*it;
	ans-=gdis(l,x)+gdis(x,r)-gdis(l,r);
}
int main()
{
	read(n);read(m);
	rep(i,n){
		read(p[i]);
	}
	rep(i,n){
		read(a[i]);
	}
	rep(i,n){
		read(b[i]);
	}
	rep(i,n){
		while(stp&&p[stk[stp]]<p[i]) stp--;
		fa[i]=stk[stp];stk[++stp]=i;
		e[fa[i]].push_back(i);
	}
	memset(fa,-1,sizeof(fa));
	memset(tp,-1,sizeof(tp));
	dfs1(0,-1);dfs2(0,0);
	rep(i,n){
		val[i]=a[i]-b[i];
		fe(it,e[i]){
			val[i]+=b[*it];
		}
	}
	repd(i,n){
		dis[i]+=val[i];
		dis[fa[i]]+=min(0ll,dis[i]);
		dis[i]-=min(0ll,dis[i]);
	}
	fe(it,e[0]) val[0]+=b[*it];
	dis[0]+=val[0];
	rep(i,n){
		dis[i]+=dis[fa[i]];
	}
	s.insert(0);cnt[0]=1;
	while(m--){
		int x;
		read(x);
		if(vis[x]){
			vis[x]=0;
			cnt[fa[x]]--;
			if(!cnt[fa[x]]) del(fa[x]);
		}
		else{
			vis[x]=1;
			cnt[fa[x]]++;
			if(cnt[fa[x]]==1) ins(fa[x]);
		}
		printf("%lld\n",ans/2+dis[0]);
	}
	return 0;
}