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:
#include <bits/stdc++.h>
#define fo(a,b,c) for (a=b; a<=c; a++)
#define fd(a,b,c) for (a=b; a>=c; a--)
#define inf 100000000000000000ll
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define Min(a,b) a=min((a),(b))
#define Max(a,b) a=max((a),(b))
#define ll long long
#define p(a,b) pair<int,int>(a,b)
//#define file
using namespace std;

int n,Q,i,j,k,l,x,y;
int p[200002],nx[200002];
int a[200002],b[200002];
ll f[200002];
vector<int> v[200002];
ll ans;
int q[200002];
struct Type{int x,y;} c[400012];
int tot;
map<pair<int,int>,ll> mp;

set<int> St;
set<int> :: iterator I2;

bool cmp(Type a,Type b) {return a.y<b.y;}

namespace tt{
	int tr[800001];
	void change(int t,int l,int r,int x,int s)
	{
		int mid=(l+r)/2;
		tr[t]=min(tr[t],s);
		if (l==r) return;
		
		if (x<=mid) change(t*2,l,mid,x,s);
		else change(t*2+1,mid+1,r,x,s);
	}
	int find(int t,int l,int r,int x,int y)
	{
		int mid=(l+r)/2,ans=n+1,s;
		if (x<=l && r<=y) return tr[t];
		
		if (x<=mid) s=find(t*2,l,mid,x,y),ans=min(ans,s);
		if (mid<y) s=find(t*2+1,mid+1,r,x,y),ans=min(ans,s);
		return ans;
	}
}

ll tr[800001];
void down(int t,int len)
{
	if (len==1) return;
	if (tr[t])
	{
		tr[t*2]=tr[t*2]+tr[t],tr[t*2+1]=tr[t*2+1]+tr[t];
		tr[t]=0;
	}
}
void change(int t,int l,int r,int x,int y,ll s)
{
	int mid=(l+r)/2;
	down(t,r-l+1);
	if (x<=l && r<=y) {tr[t]=tr[t]+s; return;}
	
	if (x<=mid) change(t*2,l,mid,x,y,s);
	if (mid<y) change(t*2+1,mid+1,r,x,y,s);
}
ll find(int t,int l,int r,int x)
{
	int mid=(l+r)/2;
	down(t,r-l+1);
	if (l==r) return tr[t];
	
	if (x<=mid) return find(t*2,l,mid,x);
	else return find(t*2+1,mid+1,r,x);
}

void init1()
{
	fo(i,1,n*4) tt::tr[i]=n+1;
	fd(i,n,1)
	{
		nx[i]=tt::find(1,1,n,p[i],n);
		tt::change(1,1,n,p[i],i);
	}
	fo(i,1,n) v[nx[i]].push_back(i);
	
	St.insert(n+1);
	fo(i,1,Q)
	{
		scanf("%d",&q[i]);
		if (q[i]!=1)
		{
			I2=St.find(q[i]);
			if (I2==St.end())
			{
				I2=St.upper_bound(q[i]),y=*I2;
				if (I2==St.begin()) x=1; else --I2,x=*I2;
				St.insert(q[i]);
				c[++tot]=Type{x,q[i]},c[++tot]=Type{q[i],y};
			}
			else
			{
				I2=St.upper_bound(q[i]),y=*I2;
				St.erase(q[i]);
				I2=St.upper_bound(q[i]);
				if (I2==St.begin()) x=1; else --I2,x=*I2;
				c[++tot]=Type{x,y};
			}
		}
	}
	c[++tot]=Type{1,n+1};
}
void init2()
{
	int I=1;
	ll s;
	sort(c+1,c+tot+1,cmp);
	
	fo(i,2,n+1)
	{
		change(1,1,n,1,i-1,a[i-1]);
		l=v[i].size();
		fd(j,l-1,0)
		{
			k=v[i][j],s=find(1,1,n,k);
			if (s>b[k]) change(1,1,n,1,k,b[k]-s);
		}
		while (I<=tot && c[I].y<=i)
		s=find(1,1,n,c[I].x),mp[p(c[I].x,c[I].y)]=s,++I;
	}
}
void work()
{
	St.clear(),St.insert(n+1);ans=mp[p(1,n+1)];
	fo(i,1,Q)
	{
		if (q[i]!=1)
		{
			I2=St.find(q[i]);
			if (I2==St.end())
			{
				I2=St.upper_bound(q[i]),y=*I2;
				if (I2==St.begin()) x=1; else --I2,x=*I2;
				St.insert(q[i]);
				ans=ans-mp[p(x,y)]+mp[p(x,q[i])]+mp[p(q[i],y)];
			}
			else
			{
				I2=St.upper_bound(q[i]),y=*I2;
				St.erase(q[i]);
				if (I2==St.begin()) x=1; else --I2,x=*I2;
				ans=ans+mp[p(x,y)]-mp[p(x,q[i])]-mp[p(q[i],y)];
			}
		}
		printf("%lld\n",ans);
	}
}

int main()
{
	#ifdef file
	freopen("CF1495F.in","r",stdin);
	#endif
	
	scanf("%d%d",&n,&Q);
	fo(i,1,n) scanf("%d",&p[i]);
	fo(i,1,n) scanf("%d",&a[i]);
	fo(i,1,n) scanf("%d",&b[i]);
	
	init1();
	init2();
	work();
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}