#include <bits/stdc++.h>
using namespace std;
const int nmax = 200010;
int n, k, a, b, q, type, d, x, p, aib[2][nmax];
int cnt[nmax];
int lsb(int x) { return (x & (x - 1)) ^ x; }
void update(int index, int pos, int val) {
  for (; pos <= n; pos += lsb(pos)) aib[index][pos] += val;
}
int query(int index, int pos) {
  int now = 0;
  for (; pos > 0; pos -= lsb(pos)) now += aib[index][pos];
  return now;
}
int main() {
  scanf("%i %i %i %i %i", &n, &k, &a, &b, &q);
  for (; q; --q) {
    scanf("%i", &type);
    if (type == 1) {
      scanf("%i %i", &d, &x);
      update(0, d, -min(cnt[d], b));
      update(1, d, -min(cnt[d], a));
      cnt[d] += x;
      update(0, d, min(cnt[d], b));
      update(1, d, min(cnt[d], a));
    } else {
      scanf("%i", &p);
      printf("%i\n", query(0, p - 1) + query(1, n) - query(1, p + k - 1));
    }
  }
}
