#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
long long INF = 1e18;
struct Node {
  int lo, hi, suma, sumb;
  Node *lchi, *rchi;
  Node(int l, int r) { lo = l, hi = r; }
};
int n, k, a, b, q, arr[200005] = {};
void segbuild(Node *u) {
  if (u->lo == u->hi) {
    u->suma = 0;
    u->sumb = 0;
  } else {
    int mi = u->lo + u->hi >> 1;
    u->lchi = new Node(u->lo, mi);
    u->rchi = new Node(mi + 1, u->hi);
    segbuild(u->lchi);
    segbuild(u->rchi);
    u->suma = u->lchi->suma + u->rchi->suma;
    u->sumb = u->lchi->sumb + u->rchi->sumb;
  }
}
pair<int, int> segquery(Node *u, int l, int r) {
  if (l == u->lo && r == u->hi) return {u->suma, u->sumb};
  int mi = u->lo + u->hi >> 1;
  if (r <= mi)
    return segquery(u->lchi, l, r);
  else if (l > mi)
    return segquery(u->rchi, l, r);
  else {
    pair<int, int> resl = segquery(u->lchi, l, mi);
    pair<int, int> resr = segquery(u->rchi, mi + 1, r);
    return {resl.first + resr.first, resl.second + resr.second};
  }
}
void segupdate(Node *u, int k, int v) {
  if (u->lo == u->hi) {
    u->suma = min(a, v);
    u->sumb = min(b, v);
  } else {
    int mi = u->lo + u->hi >> 1;
    if (k <= mi)
      segupdate(u->lchi, k, v);
    else
      segupdate(u->rchi, k, v);
    u->suma = u->lchi->suma + u->rchi->suma;
    u->sumb = u->lchi->sumb + u->rchi->sumb;
  }
}
int solve() {
  cin >> n >> k >> a >> b >> q;
  Node *tr = new Node(0, n + 1);
  segbuild(tr);
  while (q--) {
    int op;
    cin >> op;
    if (op == 1) {
      int d, v;
      cin >> d >> v;
      arr[d] += v;
      segupdate(tr, d, arr[d]);
    } else {
      int d;
      cin >> d;
      cout << segquery(tr, 0, d - 1).second + segquery(tr, d + k, n + 1).first
           << endl;
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
