#include <bits/stdc++.h>
const int N = 205000;
using namespace std;
int n, k, a, b, p, q;
int d, val;
long long t1[N * 4], t2[N * 4];
long long am1[N], am2[N];
void update(int v, int tl, int tr, int ps) {
  if (tl == tr) {
    t1[v] = am1[tl];
    t2[v] = am2[tl];
    return;
  }
  int sdfjahlfasfh = tl + tr;
  sdfjahlfasfh /= 2;
  if (ps <= sdfjahlfasfh)
    update(v * 2, tl, sdfjahlfasfh, ps);
  else
    update(v * 2 + 1, sdfjahlfasfh + 1, tr, ps);
  t1[v] = t1[v * 2] + t1[v * 2 + 1];
  t2[v] = t2[v * 2] + t2[v * 2 + 1];
}
int get(int v, int tl, int tr, int l, int r, int tp) {
  if (l > r) return 0;
  if (tl == l && tr == r) {
    if (tp == 1)
      return t1[v];
    else
      return t2[v];
  }
  int sdfjahlfasfh = tl + tr;
  sdfjahlfasfh /= 2;
  return get(v * 2, tl, sdfjahlfasfh, l, min(r, sdfjahlfasfh), tp) +
         get(v * 2 + 1, sdfjahlfasfh + 1, tr, max(sdfjahlfasfh + 1, l), r, tp);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k >> a >> b >> q;
  for (int i = 1; i <= q; i++) {
    int tp;
    cin >> tp;
    if (tp == 1) {
      long long toadd;
      long long val;
      cin >> d >> val;
      if (am1[d] < b) {
        toadd = min(b - am1[d], val);
        am1[d] += toadd;
      }
      if (am2[d] < a) {
        toadd = min(a - am2[d], val);
        am2[d] += toadd;
      }
      update(1, 1, n, d);
    } else {
      int val;
      cin >> val;
      cout << get(1, 1, n, 1, val - 1, 1) + get(1, 1, n, val + k, n, 2) << endl;
    }
  }
  cin.get();
  cin.get();
  return 0;
}
