#include <bits/stdc++.h>
using namespace std;
struct FenWick {
  int n;
  vector<int> tree;
  FenWick(int _n) : n(_n), tree(vector<int>(n + 1, 0)) {}
  int query(int x) {
    int ret = 0;
    while (x) {
      ret += tree[x];
      x -= (x & (-x));
    }
    return ret;
  }
  int query(int s, int e) {
    if (s <= e) return query(e) - query(s - 1);
    return 0;
  }
  int update(int x, int v) {
    while (x <= n) {
      tree[x] += v;
      x += (x & (-x));
    }
  }
};
int main() {
  int n, k, a, b, q;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  FenWick fw1(n), fw2(n);
  for (int i = 0; i < q; ++i) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int di, ai;
      scanf("%d%d", &di, &ai);
      if (fw1.query(di, di) < b) fw1.update(di, min(b - fw1.query(di, di), ai));
      if (fw2.query(di, di) < a) fw2.update(di, min(a - fw2.query(di, di), ai));
    } else {
      int p;
      scanf("%d", &p);
      printf("%d\n", fw1.query(1, p - 1) + fw2.query(p + k, n));
    }
  }
  return 0;
}
