A factory produces thimbles in bulk. Typically, it can produce up to a thimbles a day. However, some of the machinery is defective, so it can currently only produce b thimbles each day. The factory intends to choose a k-day period to do maintenance and construction; it cannot produce any thimbles during this time, but will be restored to its full production of a thimbles per day after the k days are complete.

Initially, no orders are pending. The factory receives updates of the form di, ai, indicating that ai new orders have been placed for the di-th day. Each order requires a single thimble to be produced on precisely the specified day. The factory may opt to fill as many or as few of the orders in a single batch as it likes.

As orders come in, the factory owner would like to know the maximum number of orders he will be able to fill if he starts repairs on a given day pi. Help the owner answer his questions.

Input

The first line contains five integers n, k, a, b, and q (1 ≤ k ≤ n ≤ 200 000, 1 ≤ b < a ≤ 10 000, 1 ≤ q ≤ 200 000) — the number of days, the length of the repair time, the production rates of the factory, and the number of updates, respectively.

The next q lines contain the descriptions of the queries. Each query is of one of the following two forms: 

  * 1 di ai (1 ≤ di ≤ n, 1 ≤ ai ≤ 10 000), representing an update of ai orders on day di, or 
  * 2 pi (1 ≤ pi ≤ n - k + 1), representing a question: at the moment, how many orders could be filled if the factory decided to commence repairs on day pi? 



It's guaranteed that the input will contain at least one query of the second type.

Output

For each query of the second type, print a line containing a single integer — the maximum number of orders that the factory can fill over all n days.

Examples

Input

5 2 2 1 8
1 1 2
1 5 3
1 2 1
2 2
1 4 2
1 3 2
2 1
2 3


Output

3
6
4


Input

5 4 10 1 6
1 1 5
1 5 5
1 3 2
1 5 2
2 1
2 2


Output

7
1

Note

Consider the first sample.

We produce up to 1 thimble a day currently and will produce up to 2 thimbles a day after repairs. Repairs take 2 days.

For the first question, we are able to fill 1 order on day 1, no orders on days 2 and 3 since we are repairing, no orders on day 4 since no thimbles have been ordered for that day, and 2 orders for day 5 since we are limited to our production capacity, for a total of 3 orders filled.

For the third question, we are able to fill 1 order on day 1, 1 order on day 2, and 2 orders on day 5, for a total of 4 orders.
import java.io.*;
import java.util.*;
public final class factory_repairs
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static Random rnd=new Random();
	static Node[] tree;
	static int n,k,a,b,q;
	
	static void build(int node,int s,int e)
	{
		if(s>e)		
		{
			return;
		}
		if(s==e)
		{
			tree[node]=new Node();
		}
		else
		{
			int mid=(s+e)>>1;
			build(node<<1,s,mid);build(node<<1|1,mid+1,e);
			tree[node]=merge(tree[node<<1],tree[node<<1|1]);
		}
	}
	
	static Node merge(Node n1,Node n2)
	{
		Node curr=new Node();
		
		curr.a[0]=n1.a[0]+n2.a[0];curr.a[1]=n1.a[1]+n2.a[1];
		
		return curr;
	}
	
	static void update(int node,int s,int e,int l,int r,int val)
	{
		if(s>e || l>e || r<s)	
		{
			return;
		}
		if(s==e)
		{
			tree[node].a[0]=Math.min(tree[node].a[0]+val,b);tree[node].a[1]=Math.min(a,tree[node].a[1]+val);
		}
		else
		{
			int mid=(s+e)>>1;
			update(node<<1,s,mid,l,r,val);update(node<<1|1,mid+1,e,l,r,val);
			tree[node]=merge(tree[node<<1],tree[node<<1|1]);
		}
	}
	
	static long query(int node,int s,int e,int l,int r,int idx)
	{
		if(s>e || l>e || r<s)
		{
			return 0;
		}
		if(l<=s && r>=e)
		{
			return tree[node].a[idx];
		}
		else
		{
			int mid=(s+e)>>1;
			long val1=query(node<<1,s,mid,l,r,idx),val2=query(node<<1|1,mid+1,e,l,r,idx);
			return (val1+val2);
		}
	}
	
    public static void main(String args[]) throws Exception
    {
		n=sc.nextInt();k=sc.nextInt();a=sc.nextInt();b=sc.nextInt();q=sc.nextInt();tree=new Node[4*n];build(1,0,n-1);
		
		while(q>0)
		{
			int t=sc.nextInt();
			if(t==1)
			{
				int idx=sc.nextInt()-1,val=sc.nextInt();update(1,0,n-1,idx,idx,val);
			}
			else
			{
				int idx=sc.nextInt()-1;out.println(query(1,0,n-1,0,idx-1,0)+query(1,0,n-1,idx+k,n-1,1));
			}
			q--;
		}
		out.close();
    }
}
class Node
{
	long[] a=new long[2];
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}