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 <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cctype>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <cassert>
#define _for(i,a,b) for(int i=(a);i<(b);++i)
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long LL;
inline int read_int(){
	int t=0;bool sign=false;char c=getchar();
	while(!isdigit(c)){sign|=c=='-';c=getchar();}
	while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();}
	return sign?-t:t;
}
inline LL read_LL(){
	LL t=0;bool sign=false;char c=getchar();
	while(!isdigit(c)){sign|=c=='-';c=getchar();}
	while(isdigit(c)){t=(t<<1)+(t<<3)+(c&15);c=getchar();}
	return sign?-t:t;
}
inline char get_char(){
	char c=getchar();
	while(c==' '||c=='\n'||c=='\r')c=getchar();
	return c;
}
inline void write(LL x){
	char c[21],len=0;
	if(!x)return putchar('0'),void();
	if(x<0)x=-x,putchar('-');
	while(x)c[++len]=x%10,x/=10;
	while(len)putchar(c[len--]+48);
}
inline void space(LL x){write(x),putchar(' ');}
inline void enter(LL x){write(x),putchar('\n');}
typedef set<int>::iterator iter;
const int MAXN=2e5+5;
struct Edge{
	int to,next;
}edge[MAXN];
int head[MAXN],edge_cnt;
void Insert(int u,int v){
	edge[++edge_cnt]=Edge{v,head[u]};
	head[u]=edge_cnt;
}
int st[MAXN],tp,p[MAXN],a[MAXN],b[MAXN],cnt[MAXN];
LL c[MAXN],dp[MAXN];
bool vis[MAXN];
namespace LCA{
	int d[MAXN],sz[MAXN],f[MAXN];
	int h_son[MAXN],mson[MAXN],p[MAXN];
	LL dis[MAXN];
	void dfs_1(int u,int fa,int depth){
		sz[u]=1;f[u]=fa;d[u]=depth;mson[u]=0;
		dp[u]=c[u];
		for(int i=head[u];i;i=edge[i].next){
			int v=edge[i].to;
			dfs_1(v,u,depth+1);
			dp[u]+=min(dp[v],0LL);
			sz[u]+=sz[v];
			if(sz[v]>mson[u])
			h_son[u]=v,mson[u]=sz[v];
		}
	}
	void dfs_2(int u,int top){
		p[u]=top;
		if(mson[u])dfs_2(h_son[u],top);
		for(int i=head[u];i;i=edge[i].next){
			int v=edge[i].to;
			if(v==h_son[u])
			continue;
			dfs_2(v,v);
		}
	}
	void dfs_3(int u){
		dis[u]+=max(dp[u],0LL);
		for(int i=head[u];i;i=edge[i].next){
			int v=edge[i].to;
			dis[v]+=dis[u];
			dfs_3(v);
		}
	}
	void init(int root){
		dfs_1(root,-1,0);
		dfs_2(root,root);
		for(int i=head[root];i;i=edge[i].next)
		dfs_3(edge[i].to);
	}
	int query_lca(int u,int v){
		while(p[u]!=p[v]){
			if(d[p[u]]<d[p[v]])swap(u,v);
			u=f[p[u]];
		}
		return d[u]<d[v]?u:v;
	}
	LL query_dis(int u,int v){
		return dis[u]+dis[v]-dis[query_lca(u,v)]*2;
	}
};
int main()
{
//	freopen("test.in","r",stdin);
//	freopen("test.out","w",stdout);
	int n=read_int(),q=read_int();
	_rep(i,1,n)p[i]=read_int();
	_rep(i,1,n)a[i]=read_int();
	_rep(i,1,n)b[i]=read_int();
	p[0]=n+1;
	_rep(i,1,n){
		while(p[st[tp]]<p[i])tp--;
		Insert(st[tp],i);
		st[++tp]=i;
	}
	_rep(u,0,n){
		c[u]=a[u]-b[u];
		for(int i=head[u];i;i=edge[i].next){
			int v=edge[i].to;
			c[u]+=b[v];
		}
	}
	LCA::init(0);
	set<int> s;
	s.insert(0);
	cnt[0]++;
	LL ans=0;
	while(q--){
		int u=read_int(),p=LCA::f[u];
		if(!vis[u]){
			cnt[p]++;
			if(cnt[p]==1){
				iter rig=s.upper_bound(p);
				iter lef=--rig;
				rig++;
				rig=(rig==s.end())?s.begin():rig;
				ans+=LCA::query_dis(p,*rig);
				ans-=LCA::query_dis(*lef,*rig);
				ans+=LCA::query_dis(*lef,p);
				s.insert(p);
			}
		}
		else{
			cnt[p]--;
			if(cnt[p]==0){
				iter rig=s.find(p);
				iter lef=--rig;
				rig++;rig++;
				rig=(rig==s.end())?s.begin():rig;
				ans-=LCA::query_dis(p,*rig);
				ans+=LCA::query_dis(*lef,*rig);
				ans-=LCA::query_dis(*lef,p);
				s.erase(p);
			}
		}
		vis[u]=!vis[u];
		enter(dp[0]+ans/2);
	}
	return 0;
}
