#include <bits/stdc++.h>
using namespace std;
struct RangeTree {
  int maxx;
  int kk;
  vector<int> b;
  RangeTree(int n, int maxx) : maxx(maxx) {
    kk = 1;
    while (kk < n) {
      kk *= 2;
    }
    b.assign(2 * kk + 10, 0);
  }
  void add(int t, int delta) {
    t += kk;
    if (b[t] == maxx) {
      return;
    }
    b[t] += delta;
    if (b[t] > maxx) {
      b[t] = maxx;
    }
    while (t > 1) {
      t /= 2;
      b[t] = b[2 * t] + b[2 * t + 1];
    }
  }
  int getSum(int L, int R) {
    L += kk, R += kk;
    int res = 0;
    while (L <= R) {
      if (L % 2 == 1) {
        res += b[L++];
      }
      if (R % 2 == 0) {
        res += b[R--];
      }
      L /= 2, R /= 2;
    }
    return res;
  }
};
int main() {
  int n, k, a, b, q;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  RangeTree tree1(n, a);
  RangeTree tree2(n, b);
  for (int i = 0; i < q; ++i) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int d, x;
      scanf("%d%d", &d, &x);
      --d;
      tree1.add(d, x);
      tree2.add(d, x);
    } else if (t == 2) {
      int p;
      scanf("%d", &p);
      --p;
      printf("%d\n", tree2.getSum(0, p - 1) + tree1.getSum(p + k, n - 1));
    } else {
      assert(0);
    }
  }
  return 0;
}
