#include <bits/stdc++.h>
using namespace std;
struct tree {
  long long sumFull;
  long long sumMax;
  tree() : sumFull(0), sumMax(0){};
  tree(long long sumFull, long long sumMax)
      : sumFull(sumFull), sumMax(sumMax){};
  tree(tree l, tree r) {
    sumFull = l.sumFull + r.sumFull;
    sumMax = l.sumMax + r.sumMax;
  }
} t[4 * 200500];
long long a, b;
int n, k;
int q;
void upd(int v, int l, int r, int pos, long long add) {
  if (l == r) {
    t[v].sumFull = min(a, t[v].sumFull + add);
    t[v].sumMax = min(b, t[v].sumMax + add);
  } else {
    int tm = (l + r) >> 1;
    if (pos <= tm)
      upd(v + v, l, tm, pos, add);
    else
      upd(v + v + 1, tm + 1, r, pos, add);
    t[v] = tree(t[v + v], t[v + v + 1]);
  }
}
long long getSumFull(int v, int tl, int tr, int l, int r) {
  if (tl == l && tr == r) return t[v].sumFull;
  long long ans = 0;
  int tm = (tl + tr) >> 1;
  if (l <= tm) ans += getSumFull(v + v, tl, tm, l, min(r, tm));
  if (r > tm) ans += getSumFull(v + v + 1, tm + 1, tr, max(l, tm + 1), r);
  return ans;
}
long long getSumMax(int v, int tl, int tr, int l, int r) {
  if (tl == l && tr == r) return t[v].sumMax;
  long long ans = 0;
  int tm = (tl + tr) >> 1;
  if (l <= tm) ans += getSumMax(v + v, tl, tm, l, min(r, tm));
  if (r > tm) ans += getSumMax(v + v + 1, tm + 1, tr, max(l, tm + 1), r);
  return ans;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  while (q--) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int aa, dd;
      scanf("%d%d", &dd, &aa);
      upd(1, 1, n, dd, 1ll * aa);
    }
    if (type == 2) {
      int pos;
      scanf("%d", &pos);
      long long left = 0, right = 0;
      if (pos > 1) left += getSumMax(1, 1, n, 1, pos - 1);
      if (pos + k - 1 < n) right += getSumFull(1, 1, n, pos + k, n);
      printf("%I64d\n", left + right);
    }
  }
  return 0;
}
