#include <bits/stdc++.h>
using namespace std;
struct Fenwick_Tree_Sum {
  vector<long long> tree;
  Fenwick_Tree_Sum(const vector<long long>& Arg) {
    tree.resize(Arg.size());
    for (long long i = 0; i < (long long)tree.size(); i++) increase(i, Arg[i]);
  }
  void increase(long long i, long long delta) {
    for (; i < (long long)tree.size(); i |= i + 1) tree[i] += delta;
  }
  long long getsum(long long left, long long right) {
    return sum(right) - sum(left - 1);
  }
  long long sum(long long ind) {
    long long sum = 0;
    while (ind >= 0) {
      sum += tree[ind];
      ind &= ind + 1;
      ind--;
    }
    return sum;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  Fenwick_Tree_Sum full(vector<long long>(n, 0));
  Fenwick_Tree_Sum part(vector<long long>(n, 0));
  vector<long long> orders(n, 0);
  long long t, d, o, p;
  for (long long i = 0; i < q; i++) {
    cin >> t;
    if (t == 1) {
      cin >> d >> o;
      d--;
      orders[d] += o;
      full.increase(d, min(orders[d], a) - full.getsum(d, d));
      part.increase(d, min(orders[d], b) - part.getsum(d, d));
    } else {
      cin >> p;
      p--;
      long long total = part.sum(p - 1);
      if (p + k <= n - 1) total += full.getsum(p + k, n - 1);
      cout << total << '\n';
    }
  }
  return 0;
}
