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<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
#include<set>
typedef long long ll;
typedef unsigned un;
typedef std::vector<int> P;
typedef std::pair<int,int> pii;
ll read(){ll x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9')x=x*10+(c-'0'),c=getchar();return f*x;}
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
template <typename T> bool umax(T& a,T t){if(t>a)return a=t,1;return 0;}
template <typename T> bool umin(T& a,T t){if(t<a)return a=t,1;return 0;}
int abs(int x){return x>0?x:-x;}
/**********/
const int MAXN = 400011;
int p[MAXN],a[MAXN],b[MAXN];
int fa[MAXN],size[MAXN],ms[MAXN],dep[MAXN];
std::vector<int>g[MAXN];
void dfs1(int u)
{
	size[u]=1;
	for(auto v:g[u])
	{
		dep[v]=dep[u]+1,dfs1(v),size[u]+=size[v];
		if(size[v]>size[ms[u]])ms[u]=v;
	}
}
int Top[MAXN];
void dfs2(int s)
{
	for(int u=s;u;u=ms[u])
		Top[u]=s;
	for(int u=s;u;u=ms[u])
		for(auto v:g[u])
			if(v!=ms[u])dfs2(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]?v:u;
}
ll val[MAXN];
ll dist(int u,int v)
{
	return val[u]+val[v]-2*val[LCA(u,v)];
}
int stk[MAXN],top=0;
std::set<int>s;
ll ans;
bool must[MAXN];
int son[MAXN];
void Add(int x)
{
	auto it=s.lower_bound(x),tp=it;
	int pre=(it==s.begin()?*s.rbegin():*--tp);
	int nxt=(it==s.end()?*s.begin():*it);
	ans-=dist(pre,nxt);
	ans+=dist(pre,x)+dist(x,nxt);
	s.insert(x);
}
void Remove(int x)
{
	s.erase(x);
	auto it=s.lower_bound(x),tp=it;
	int pre=(it==s.begin()?*s.rbegin():*--tp);
	int nxt=(it==s.end()?*s.begin():*it);
	ans-=dist(pre,x)+dist(x,nxt),ans+=dist(pre,nxt);
}
int main()
{
	int n=read(),m=read(),R=n+1;
	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();
	stk[0]=R;
	for(int i=1;i<=n;++i)
	{
		while(top&&p[stk[top]]<=p[i])--top;
		fa[i]=stk[top],stk[++top]=i;
		val[i]=a[i]-b[i],val[fa[i]]+=b[i];
		g[fa[i]].push_back(i);
	}
	for(int i=n;i;--i)
		if(val[i]<0)val[fa[i]]+=val[i],val[i]=0;
	for(int i=1;i<=n;++i)val[i]+=val[fa[i]];
	dfs1(R),dfs2(R);
	ans=0;
	son[R]=1000000000;
	s.insert(R);
	while(m--)
	{
		int x=read();
		if(must[x])
		{
			if(!--son[fa[x]])Remove(fa[x]);
		}
		else
		{
			if(!son[fa[x]]++)Add(fa[x]);
		}
		must[x]^=1;
		printf("%lld\n",(ans>>1)+val[R]);
	}
	return 0;
}
