#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q, resa[200001], resb[200001];
struct fenwick {
  int f[200001];
  void update(int i, int v) {
    while (i <= n) f[i] += v, i += i & (-i);
  }
  int query(int i) {
    int ret = 0;
    while (i > 0) ret += f[i], i -= i & (-i);
    return ret;
  }
} fta, ftb;
int main() {
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  for (int i = 0; i < q; i++) {
    int tp;
    scanf("%d", &tp);
    if (tp == 1) {
      int di, ai, ta, tb;
      scanf("%d%d", &di, &ai);
      ta = min(resa[di] + ai, a) - resa[di];
      tb = min(resb[di] + ai, b) - resb[di];
      fta.update(di, ta);
      ftb.update(di, tb);
      resa[di] += ta;
      resb[di] += tb;
    } else {
      int p;
      scanf("%d", &p);
      printf("%d\n", ftb.query(p - 1) + fta.query(n) - fta.query(p + k - 1));
    }
  }
}
