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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Random;
import java.util.StringTokenizer;

public class D {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();

        numDays = sc.nextInt();
        fixTime = sc.nextInt();
        prodRateNormal = sc.nextInt();
        prodRateOdd = sc.nextInt();
        int numUpdates = sc.nextInt();

        Tree normal = new Tree(numDays);
        Tree odd = new Tree(numDays);

        StringBuilder sb = new StringBuilder();
        for (int i =0 ; i < numUpdates; i++) {
            int type = sc.nextInt();
            if (type == 1) {
                int day = sc.nextInt() - 1;
                int numOrders = sc.nextInt();
                long sumNormal = normal.getSingle(day);
                long sumNormal2 = Math.min(sumNormal+numOrders, prodRateNormal);
                sumNormal2 -= sumNormal;
                normal.add(day, sumNormal2);
                long sumOdd = odd.getSingle(day);
                long sumOdd2 = Math.min(sumOdd+numOrders, prodRateOdd);
                sumOdd2 -= sumOdd;
                odd.add(day, sumOdd2);
            } else {
                int day = sc.nextInt() - 1;
                int oddStart = 0;
                int oddEnd = day-1;
                int normalStart = day+fixTime;
                int normalEnd = numDays-1;
                long left = 0;
                long right = 0;
                if (oddEnd >= 0) {
                    left = odd.getRangeSum(oddStart, oddEnd);
                }
                if (normalStart < numDays) {
                    right = normal.getRangeSum(normalStart, normalEnd);
                }
                long sum = left + right;
//                System.out.printf("[%d, %d] + [%d, %d]\n", oddStart, oddEnd, normalStart, normalEnd);
//                System.out.printf("%d + %d = %d\n", left, right, sum);
                sb.append(sum).append('\n');
            }
        }

        System.out.print(sb);
    }
    static int numDays;
    static int fixTime;
    static int prodRateNormal;
    static int prodRateOdd;

    public static class SumSegmentTree {
        int start;
        int end;
        SumSegmentTree Left;
        SumSegmentTree Right;
        long sum;
        long actualProduction;
        long actualProductionNormal;

        public SumSegmentTree(int start2, int end2) {
            if (start2 > end2) {
                throw new AssertionError();
            }
            start = start2;
            end = end2;
            if (start2 != end2){
                Left = new SumSegmentTree(start2, start2 + (end2 - start2) / 2);
                Right = new SumSegmentTree(start2 + (end2 - start2) / 2 + 1, end2);
            }
            else{
                Left = null;
                Right = null;
            }
            sum = 0;
            actualProduction = 0;
            actualProductionNormal = 0;
        }

        public long add(int index, int amount) {
            if (start <= index && end >= index) {
                sum = sum + amount;
//                actualProduction = Math.min(prodRateOdd, sum);
            }
            if (start > index || end < index){
                return 0;
            }
            if (start == end) {
                actualProduction = Math.min(prodRateOdd, sum);
                return actualProduction;
            }
//            actualProduction = 0;
            actualProduction += Left.add(index, amount);
            actualProduction += Right.add(index, amount);
            return actualProduction;
        }

        public long fakeAdd(int index) {
            if (start > index || end < index){
                return 0;
            }
            if (start == end) {
                actualProductionNormal = Math.min(prodRateNormal, sum);
                return actualProductionNormal;
            }
//            actualProductionNormal = 0;
            actualProductionNormal += Left.fakeAdd(index);
            actualProductionNormal += Right.fakeAdd(index);
            return actualProductionNormal;
        }

        public long update(int left, int right, int prodRate) {
            if (start > right || end < left){
                return 0;
            }
            if (start == end) {
                actualProduction = Math.min(prodRate, sum);
                return actualProduction;
            }
            actualProduction = 0;
            actualProduction += Left.update(left, right, prodRate);
            actualProduction += Right.update(left, right, prodRate);
            return actualProduction;
        }

        public long rangeSearch(int left, int right) {
            if (left > end || right < start) {
                return 0;
            }
            if (left <= start && right >= end){
                return actualProduction;
            }
            return Left.rangeSearch(left, right) + Right.rangeSearch(left, right);
        }

        public long rangeSearch2(int left, int right) {
            if (left > end || right < start) {
                return 0;
            }
            if (left <= start && right >= end){
                return actualProductionNormal;
            }
            return Left.rangeSearch2(left, right) + Right.rangeSearch2(left, right);
        }

        public void string() {
            string("", this);
        }

        public void string(String indent, SumSegmentTree a) {
            System.out.println(indent + "RANGE: " + a.start + "-" + a.end);
            System.out.println(indent + "SUM: " + a.sum);
            if (a.start != a.end) {
                string(indent + "\t", a.Left);
                string(indent + "\t", a.Right);
            }
        }
    }

    static class Tree {
        private long[] tree;

        /* Initialize all elements to zero. */
        Tree(int size) {
            this.tree = new long[size];
        }

        /* O(log n) get sum of tree[0..idx], inclusive */
        long getPartialSum(int idx) {
            long res = 0;
            while (idx >= 0) {
                res += tree[idx];
                idx = (idx & (idx + 1)) - 1;
            }
            return res;
        }

        /* O(log n) update.  t[idx] += val */
        void add(int idx, long val) {
            while (idx < tree.length) {
                tree[idx] += val;
                idx |= (idx + 1);
            }
        }

        /* O(log n) return t[idx] */
        long getSingle(int idx){
            long sum = tree[idx];
            if (idx > 0) {
                int z = (idx & (idx + 1)) - 1;
                idx--;
                while (idx != z) {
                    sum -= tree[idx];
                    idx = (idx & (idx + 1)) - 1;
                }
            }
            return sum;
        }

        /* O(log n) return sum(t[idx] for idx in range[from, to]) */
        long getRangeSum(int from, int to) {
            return getPartialSum(to) - getPartialSum(from - 1);
        }

        /* can also do: scaling in O(n),
         * searching for given cumulative freq in O(log n),
         * adding to entire range in O(log n)
         */
    }

    static void shuffle(int[] arr) {
        Random rng = new Random();
        int length = arr.length;
        for (int idx = 0; idx < arr.length; idx++) {
            int toSwap = idx + rng.nextInt(length-idx);
            int tmp = arr[idx];
            arr[idx] = arr[toSwap];
            arr[toSwap] = tmp;
        }
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}
