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 class _8VCFinalsqC {
	
	static int n,k,a,b,q;
	static long segtree1[], segtree2[];

	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);

		n = in.nextInt();
		k = in.nextInt();
		a = in.nextInt();
		b = in.nextInt();
		q = in.nextInt();
		
		segtree1 = new long[4*n];
		segtree2 = new long[4*n];
		
		for(int i = 0; i < q; i++){
			int t = in.nextInt();
			if(t == 1){
				int d = in.nextInt() - 1;
				int a = in.nextInt();
				update1(0 , n - 1 , 0 , d , a);
				update2(0 , n - 1 , 0 , d , a);
			}
			else{
				int p = in.nextInt() - 1;
				int ans = 0;
				if(p != 0)
					ans += find2(0 , n - 1 , 0 , 0 , p - 1);
				p += k;
				if(p < n)
					ans += find1(0 , n - 1,  0 , p, n - 1);
				w.println(ans);
			}
		}

		w.close();
	}
	
	public static void update1(int s,int e,int c,int x,int v){
		if(s == e)	{
			segtree1[c] += v;
			segtree1[c] = Math.min(segtree1[c], a);
			return;
		}
		int m = (s + e) >> 1;
		if(x <= m)  update1(s,m,2*c+1,x,v);
		else		update1(m+1,e,2*c+2,x,v);
		segtree1[c] = merge(segtree1[2*c+1],segtree1[2*c+2]);
	}
	
	public static long find1(int s,int e,int c,int l,int r){
		if(s == l && e == r) return segtree1[c];
		int m = (s + e) >> 1;
		if(r <= m) return find1(s,m,2*c+1,l,r);
		if(l >  m) return find1(m+1,e,2*c+2,l,r);
		return merge(find1(s,m,2*c+1,l,m) , find1(m+1,e,2*c+2,m+1,r));
	}
	
	public static void update2(int s,int e,int c,int x,int v){
		if(s == e)	{
			segtree2[c] += v;
			segtree2[c] = Math.min(segtree2[c], b);
			return;
		}
		int m = (s + e) >> 1;
		if(x <= m)  update2(s,m,2*c+1,x,v);
		else		update2(m+1,e,2*c+2,x,v);
		segtree2[c] = merge(segtree2[2*c+1],segtree2[2*c+2]);
	}
	
	public static long find2(int s,int e,int c,int l,int r){
		if(s == l && e == r) return segtree2[c];
		int m = (s + e) >> 1;
		if(r <= m) return find2(s,m,2*c+1,l,r);
		if(l >  m) return find2(m+1,e,2*c+2,l,r);
		return merge(find2(s,m,2*c+1,l,m) , find2(m+1,e,2*c+2,m+1,r));
	}
	
	public static long merge(long a,long b){
		return a + b;
	}
	
	static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}