#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 123;
const long long INF = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
inline void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}
int n, k, a, b, q;
struct tree {
  int val, kald;
  int val1, kald1;
} t[4 * N];
tree mrg(tree q, tree w) {
  tree res;
  res.val = q.val + w.val;
  res.kald = q.kald + w.kald;
  res.val1 = q.val1 + w.val1;
  res.kald1 = q.kald1 + w.kald1;
  return res;
}
void update(int id, int x, int v = 1, int tl = 1, int tr = n) {
  if (tl == tr) {
    t[v].val += x;
    if (t[v].val > b) {
      t[v].kald += t[v].val - b;
      t[v].val = b;
      if (t[v].kald + t[v].val > a) t[v].kald = a - t[v].val;
    }
    return;
  }
  int mid = (tl + tr) / 2;
  if (id <= mid)
    update(id, x, v * 2, tl, mid);
  else
    update(id, x, v * 2 + 1, mid + 1, tr);
  t[v] = mrg(t[v * 2], t[v * 2 + 1]);
}
void update_1(int l, int r, int tp, int v = 1, int tl = 1, int tr = n) {
  if (l > r || tl > tr || tl > r || l > tr) return;
  if (l <= tl && tr <= r) {
    if (tp == 1) t[v].val += t[v].kald;
    if (tp == 2) t[v].val -= t[v].kald;
    return;
  }
  int mid = (tl + tr) / 2;
  update_1(l, r, tp, v * 2, tl, mid);
  update_1(l, r, tp, v * 2 + 1, mid + 1, tr);
  t[v] = mrg(t[v * 2], t[v * 2 + 1]);
}
void update_2(int l, int r, int tp, int v = 1, int tl = 1, int tr = n) {
  if (l > r || tl > tr || tl > r || l > tr) return;
  if (l <= tl && tr <= r) {
    if (tp == 1) {
      t[v].val1 = t[v].val;
      t[v].kald1 = t[v].kald;
      t[v].val = t[v].kald = 0;
    }
    if (tp == 2) {
      t[v].val = t[v].val1;
      t[v].kald = t[v].kald1;
      t[v].kald1 = t[v].val1 = 0;
    }
    return;
  }
  int mid = (tl + tr) / 2;
  update_2(l, r, tp, v * 2, tl, mid);
  update_2(l, r, tp, v * 2 + 1, mid + 1, tr);
  t[v] = mrg(t[v * 2], t[v * 2 + 1]);
}
int main() {
  boost();
  cin >> n >> k >> a >> b >> q;
  for (int i = 1, x, y, tp; i <= q; i++) {
    cin >> tp;
    if (tp == 1) {
      cin >> x >> y;
      update(x, y);
    } else {
      cin >> x;
      update_2(x, x + k - 1, 1);
      update_1(x + k, n, 1);
      cout << t[1].val << endl;
      update_2(x, x + k - 1, 2);
      update_1(x + k, n, 2);
    }
  }
  return 0;
}
