#include <bits/stdc++.h>
using namespace std;
void update(vector<int> &f, int id, int l, int r, int k, int val, int limit) {
  if (r - l < 2) {
    f[id] = min(limit, f[id] + val);
    return;
  };
  int mid = (l + r) / 2;
  if (k < mid)
    update(f, id * 2, l, mid, k, val, limit);
  else
    update(f, id * 2 + 1, mid, r, k, val, limit);
  f[id] = f[id * 2] + f[id * 2 + 1];
};
long long query(vector<int> &f, int id, int x, int y, int l, int r) {
  if (x >= r || y <= l) return 0;
  if (l >= x && r <= y) return f[id];
  int mid = (l + r) / 2;
  return query(f, id * 2, x, y, l, mid) + query(f, id * 2 + 1, x, y, mid, r);
};
int main() {
  int n, k, a, b, q;
  scanf("%d %d %d %d %d", &n, &k, &a, &b, &q);
  vector<int> f((1 << 22), 0);
  auto g = f;
  for (int i = 0; i < q; ++i) {
    int type;
    scanf("%d", &type);
    if (type == 1) {
      int d, q;
      scanf("%d %d", &d, &q);
      update(f, 1, 0, n, d - 1, q, a);
      update(g, 1, 0, n, d - 1, q, b);
    } else {
      int p;
      scanf("%d ", &p);
      --p;
      long long ans = 0;
      if (p != 0) ans += query(g, 1, 0, p, 0, n);
      if (p + k < n) ans += query(f, 1, p + k, n, 0, n);
      printf("%lld\n", ans);
    };
  };
}
