#include <bits/stdc++.h>
using namespace std;
struct FenwickTree {
  int n;
  int* a;
  FenwickTree(int n) : n(n) {
    a = new int[n];
    for (int i = 0; i < (n); i++) a[i] = 0;
  }
  void inc(int x, int v) {
    for (; x < n; x |= x + 1) a[x] += v;
  }
  int getsum(int r) {
    int res = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) res += a[r];
    return res;
  }
  int getsum(int l, int r) { return getsum(r) - getsum(l - 1); }
};
const int MAXN = 200000;
int v1[MAXN], v2[MAXN];
int main() {
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  FenwickTree t1(n), t2(n);
  for (int i = 0; i < (q); i++) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int d, add;
      scanf("%d%d", &d, &add);
      d--;
      {
        int old = v1[d];
        v1[d] += add;
        v1[d] = min(v1[d], b);
        t1.inc(d, v1[d] - old);
      }
      {
        int old = v2[d];
        v2[d] += add;
        v2[d] = min(v2[d], a);
        t2.inc(d, v2[d] - old);
      }
    } else {
      int p;
      scanf("%d", &p);
      p--;
      printf("%d\n", t1.getsum(0, p - 1) + t2.getsum(p + k, n - 1));
    }
  }
  return 0;
}
