#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q;
int f[200010], ca[200010], cb[200010];
void add(int c[200010], int x, int y) {
  for (; x <= n; x += x & -x) c[x] += y;
}
int query(int c[200010], int x) {
  int y = 0;
  for (; x; x -= x & -x) y += c[x];
  return y;
}
int ask(int c[200010], int l, int r) {
  if (l > r) return 0;
  return query(c, r) - query(c, l - 1);
}
int main() {
  cin >> n >> k >> b >> a >> q;
  for (int i = 1; i <= q; i++) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int x, y;
      scanf("%d%d", &x, &y);
      int now = f[x];
      f[x] += y;
      if (now < a) add(ca, x, min(a, f[x]) - now);
      if (now < b) add(cb, x, min(b, f[x]) - now);
    } else {
      int x, y;
      scanf("%d", &x);
      y = x + k - 1;
      printf("%d\n", ask(ca, 1, x - 1) + ask(cb, y + 1, n));
    }
  }
  return 0;
}
