#include <bits/stdc++.h>
class Fenwick {
 public:
  Fenwick() {
    memset(tree, 0, sizeof(long long) * 200007);
    memset(a, 0, sizeof(long long) * 200007);
  }
  void Update(int i, long long delta) {
    a[i] += delta;
    for (; i < 200007; i = (i | (i + 1))) tree[i] += delta;
  }
  long long GetSum(int r) const {
    long long result = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) result += tree[r];
    return result;
  }
  long long GetSum(int l, int r) const {
    if (l > r) return 0;
    return GetSum(r) - GetSum(l - 1);
  }
  long long operator[](int i) const { return a[i]; }

 private:
  long long tree[200007], a[200007];
};
int main() {
  std::ios_base::sync_with_stdio(0);
  int n, k, a, b, q, id, d, x, p;
  std::cin >> n >> k >> a >> b >> q;
  Fenwick fa, fb;
  long long elem, new_elem, ans;
  for (int i = 0; i < q; i++) {
    std::cin >> id;
    if (id == 1) {
      std::cin >> d >> x;
      elem = fa[d];
      new_elem = std::min(elem + x, (long long)a);
      fa.Update(d, new_elem - elem);
      elem = fb[d];
      new_elem = std::min(elem + x, (long long)b);
      fb.Update(d, new_elem - elem);
    } else {
      std::cin >> p;
      ans = fb.GetSum(p - 1) + fa.GetSum(p + k, 200007 - 3);
      std::cout << ans << std::endl;
    }
  }
  return 0;
}
