#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q;
vector<int> ta;
vector<int> tb;
int suma(int l, int r, int v = 1, int tl = 0, int tr = n - 1) {
  if (l == tl && r == tr) return ta[v];
  int tm = (tl + tr) / 2;
  if (r <= tm) return suma(l, r, 2 * v, tl, tm);
  if (l >= tm + 1) return suma(l, r, 2 * v + 1, tm + 1, tr);
  return suma(l, tm, 2 * v, tl, tm) + suma(tm + 1, r, 2 * v + 1, tm + 1, tr);
}
int sumb(int l, int r, int v = 1, int tl = 0, int tr = n - 1) {
  if (l == tl && r == tr) return tb[v];
  int tm = (tl + tr) / 2;
  if (r <= tm) return sumb(l, r, 2 * v, tl, tm);
  if (l >= tm + 1) return sumb(l, r, 2 * v + 1, tm + 1, tr);
  return sumb(l, tm, 2 * v, tl, tm) + sumb(tm + 1, r, 2 * v + 1, tm + 1, tr);
}
void add(int x, int d, int v = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    if (ta[v] + x > a)
      ta[v] = a;
    else
      ta[v] += x;
    if (tb[v] + x > b)
      tb[v] = b;
    else
      tb[v] += x;
  } else {
    if (d <= (l + r) / 2)
      add(x, d, 2 * v, l, (l + r) / 2);
    else
      add(x, d, 2 * v + 1, (l + r) / 2 + 1, r);
    ta[v] = ta[2 * v] + ta[2 * v + 1];
    tb[v] = tb[2 * v] + tb[2 * v + 1];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k >> a >> b >> q;
  ta.resize(4 * n + 1);
  tb.resize(4 * n + 1);
  vector<int> ans;
  int r, x, y;
  for (int i = 0; i < q; i++) {
    cin >> r;
    if (r == 1) {
      cin >> x >> y;
      add(y, x - 1);
    } else {
      cin >> x;
      x--;
      ans.push_back(((x > 0) ? sumb(0, x - 1) : 0) +
                    ((x + k < n) ? suma(x + k, n - 1) : 0));
    }
  }
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
