#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:250000000")
using namespace std;
class leg {
 public:
  int length, energy;
  bool operator<(leg another) { return length < another.length; }
};
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
const int N = 300009;
vector<long long> qi(N), uqa(N), uqb(N);
int n, k, a, b, q;
int next_bite(int x) {
  int div = 1;
  while ((div & x) > 0) div = div << 1;
  return x + div;
}
int prev_bite(int x) {
  int div = 1;
  while ((div & x) > 0) div = div << 1;
  return x - div;
}
void upgr(int d, int num, vector<long long>& uq) {
  uq[d] += num;
  d = next_bite(d);
  if (d < n) upgr(d, num, uq);
}
long long calc(int d, vector<long long>& uq) {
  long long res = 0;
  if (d < 0) return 0;
  while (d >= 0) {
    res += uq[d];
    d = prev_bite(d);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> b >> a >> q;
  long long all = 0, answ = 0;
  for (int t = 0; t < q; ++t) {
    int clas;
    cin >> clas;
    if (clas == 1) {
      int d, numb = 0, numa = 0;
      cin >> d >> numb;
      d--;
      numa = numb;
      if (qi[d] + numb > b) numb = b - qi[d];
      if (qi[d] + numa > a) numa = max(a - qi[d], (long long)0);
      qi[d] += numb;
      upgr(d, numa, uqa);
      upgr(d, numb, uqb);
      all += numb;
    } else {
      answ = all;
      int d;
      cin >> d;
      d--;
      answ += calc(d - 1, uqa);
      answ -= calc(d + k - 1, uqb);
      cout << answ << "\n";
    }
  }
  return 0;
}
