#include <bits/stdc++.h>
using namespace std;
int i, j, k, p, l, m, n, r, f;
struct node {
  int val;
  node *cl, *cr;
  void shep(int l, int r, int x) { this->val = (r - l) * x; }
  node(int l, int r, int x) {
    this->val = (r - l) * x;
    this->cl = NULL;
    this->cr = NULL;
  }
  node() {
    this->val = 0;
    this->cl = NULL;
    this->cr = NULL;
  }
};
void init(node*& n, int l, int r) {
  if (l >= r) return;
  if (n == NULL) n = new node();
  if (l == r - 1) {
    n->val = 0;
    return;
  }
  init(n->cl, l, (l + r) / 2);
  init(n->cr, (l + r) / 2, r);
  n->val = ((n->cl) ? (n->cl->val) : 0) + ((n->cr) ? (n->cr->val) : 0);
}
int wl, wr;
int sum(node*& n, int l, int r) {
  if (l >= r) return 0;
  if (wr < l || r <= wl) return 0;
  if (n == NULL) {
    return 0;
  }
  if (wl <= l && r - 1 <= wr) return n->val;
  return sum(n->cl, l, (l + r) / 2) + sum(n->cr, (l + r) / 2, r);
}
int wx, x;
void update(node*& n, int l, int r) {
  if (l >= r) return;
  if (x < l || r <= x) return;
  if (n == NULL) {
    n = new node();
  }
  if (r - 1 == l && x) {
    n->val = wx;
    ;
    return;
  }
  update(n->cl, l, (l + r) / 2);
  update(n->cr, (l + r) / 2, r);
  n->val = ((n->cl) ? (n->cl->val) : 0) + ((n->cr) ? (n->cr->val) : 0);
}
int a, b, q, d[int(3e5 + 11)], kk;
int main() {
  node *r1 = NULL, *r2 = NULL;
  cin >> n >> kk >> b >> a >> q;
  int K;
  K = 1;
  while (K < n + 1) K *= 2;
  K++;
  init(r1, 1, K);
  init(r2, 1, K);
  K--;
  int gilocavdabadebisdgesbaqar;
  while (q--) {
    cin >> gilocavdabadebisdgesbaqar;
    if (gilocavdabadebisdgesbaqar == 1) {
      cin >> k >> p;
      d[k] += p;
      x = k;
      wx = min(d[k], a);
      update(r1, 1, K);
      wx = min(d[k], b);
      update(r2, 1, K);
    } else {
      cin >> k;
      wl = 1;
      wr = k - 1;
      int pas = 0;
      pas += sum(r1, 1, K);
      wl = kk + k;
      wr = n + 1;
      pas += sum(r2, 1, K);
      cout << pas << endl;
    }
  }
  return 0;
}
