#include <bits/stdc++.h>
using namespace std;
class Fenwick_Tree_Sum {
 public:
  vector<long long int> tree;
  long long int maximumEach;
  Fenwick_Tree_Sum(int sizeElements, long long int maximum) {
    tree.resize(sizeElements);
    maximumEach = maximum;
  }
  void increase(int i, long long int delta) {
    long long int before = getsum(i, i);
    if (before + delta > maximumEach) delta = maximumEach - before;
    for (; i < (int)tree.size(); i |= i + 1) tree[i] += delta;
  }
  long long int getsum(int left, int right) {
    return sum(right) - sum(left - 1);
  }
  long long int sum(int ind) {
    long long int sum = 0;
    while (ind >= 0) {
      sum += tree[ind];
      ind &= ind + 1;
      ind--;
    }
    return sum;
  }
};
int main() {
  int i, j, n, k, a, b, q, type, x, y;
  bool taken;
  scanf("%d %d %d %d %d\n", &n, &k, &a, &b, &q);
  Fenwick_Tree_Sum treeMax(n, a);
  Fenwick_Tree_Sum treeMin(n, b);
  while (q--) {
    scanf("%d ", &type);
    if (type == 1) {
      scanf("%d %d\n", &x, &y);
      x--;
      treeMax.increase(x, y);
      treeMin.increase(x, y);
    } else if (type == 2) {
      scanf("%d\n", &x);
      x--;
      long long int ans = 0;
      if (x > 0) {
        ans += treeMin.getsum(0, x - 1);
      }
      x += k;
      if (x <= n - 1) {
        ans += treeMax.getsum(x, n - 1);
      }
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
