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<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define fir first
#define sec second
#define mod 998244353
#define int long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
inline int read()
{
	char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();}
	int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();}
	if(nega==-1) return -ans;
	return ans;
}
void print(vector<int> x){for(int i=0;i<(int)x.size();i++) printf("%d%c",x[i]," \n"[i==(int)x.size()-1]);}
typedef pair<int,int> pii;
#define N 200005
int p[N],a[N],b[N],n,Q;
int pre[N],st[N],val[N],sum[N],tp;
vector<int> G[N];
void dfs1(int u)
{
	val[u]=a[u]-b[u];
	for(int v:G[u]) dfs1(v),val[u]+=b[v];
}
void dfs2(int u)
{
	for(int v:G[u]) dfs2(v);
	if(val[u]<0&&u) val[pre[u]]+=val[u],val[u]=0;
}
int dep[N],siz[N],son[N],dfn[N],top[N],fa[N];
void dfs3(int u)
{
	sum[u]=sum[pre[u]]+val[u];
	dep[u]=dep[pre[u]]+1,siz[u]=1;
	son[u]=N-1;
	for(int v:G[u])
	{
		dfs3(v);
		siz[u]+=siz[v];
		if(siz[v]>siz[son[u]]) son[u]=v;
	}
}
void dfs4(int u,int tp)
{
	top[u]=tp;
	if(!son[u]) return ;
	dfs4(son[u],tp);
	for(int v:G[u]) if(v!=son[u]) dfs4(v,v);
}
int lca(int u,int v)
{
	while(top[u]!=top[v])
	{
		if(dep[top[u]]>dep[top[v]]) u=fa[top[u]];
		else v=fa[top[v]];
	}
	return dep[u]<dep[v]?u:v;
}
int dis(int u,int v)
{
	int l=lca(u,v);
	return sum[u]+sum[v]-sum[l]*2;
}
int ans=0;
set<int> s;
void ins(int id)
{
	auto it=s.lower_bound(id);
	int pre,suf; it--; pre=*it;
	it++;
	if(it==s.end()) suf=0;
	else suf=*it;
	// printf("%d %d %d\n",pre,id,suf);
	ans+=dis(pre,id)+dis(id,suf)-dis(pre,suf);
	s.insert(id);
}
void del(int id)
{
	s.erase(id);
	auto it=s.lower_bound(id);
	int pre,suf; it--; pre=*it;
	it++;
	if(it==s.end()) suf=0;
	else suf=*it;
	ans-=dis(pre,id)+dis(id,suf)-dis(pre,suf);
}
int cnt[N],vis[N];
signed main()
{
	cin>>n>>Q;
	for(int i=1;i<=n;i++) p[i]=read();
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1;i<=n;i++) b[i]=read();
	p[0]=inf; st[++tp]=0;
	for(int i=1;i<=n;i++)
	{
		while(p[i]>p[st[tp]]) tp--;
		pre[i]=st[tp],st[++tp]=i;
	}
	// for(int i=1;i<=n;i++) printf("%d%c",pre[i]," \n"[i==n]);
	for(int i=1;i<=n;i++) G[pre[i]].pb(i);
	pre[0]=N-1; s.insert(0),cnt[0]=inf;
	for(int i=0;i<=n;i++) fa[i]=pre[i];
	// for(int i=0;i<=n;i++)
	// {
		// printf("%lld : ",i); print(G[i]);
	// }
	dfs1(0),dfs2(0),dfs3(0),dfs4(0,0);
	// for(int i=0;i<=n;i++) printf("%d%c",val[i]," \n"[i==n]);
	ans=val[0]*2;
	while(Q--)
	{
		int u=read();
		if(!vis[u])
		{
			if(!cnt[pre[u]]++) ins(pre[u]);
		}
		else
		{
			if(!--cnt[pre[u]]) del(pre[u]);
		}
		vis[u]^=1;
		printf("%lld\n",ans/2);
	}
	return 0;
}


