#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q, i, x, y, op, c[200010], d[200010], p[200010];
inline void ins(int x, int y) {
  for (int i = x; i <= n; i += i & -i) c[i] += min(y, max(b - p[x], 0));
}
inline void ins1(int x, int y) {
  for (int i = x; i; i -= i & -i) d[i] += min(y, max(a - p[x], 0));
}
inline int qry(int x) {
  int ans = 0;
  for (int i = x; i; i -= i & -i) ans += c[i];
  return ans;
}
inline int qry1(int x) {
  int ans = 0;
  for (int i = x; i <= n; i += i & -i) ans += d[i];
  return ans;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  for (i = 1; i <= q; i++) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%d", &x, &y);
      ins(x, y);
      ins1(x, y);
      p[x] += y;
    } else
      scanf("%d", &x), printf("%d\n", qry(x - 1) + qry1(x + k));
  }
  return 0;
}
