#include <bits/stdc++.h>
using namespace std;
int n, x[200200], y[200200];
int s[200200], t[200200];
int add(int *s, int k, int v) {
  while (k <= n) {
    s[k] += v;
    k += k & -k;
  }
}
int sum(int *s, int k, int v = 0) {
  while (k) {
    v += s[k];
    k -= k & -k;
  }
  return v;
}
int main() {
  int k, a, b, q;
  int i, v;
  int type, st, en;
  scanf("%d %d %d %d %d", &n, &k, &a, &b, &q);
  while (q--) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d %d", &i, &v);
      int nx = min(b, x[i] + v);
      int ny = min(a, y[i] + v);
      add(s, i, nx - x[i]);
      add(t, i, ny - y[i]);
      x[i] = nx;
      y[i] = ny;
    } else {
      scanf("%d", &st);
      en = st + k - 1;
      int answer = sum(s, st - 1) + sum(t, n) - sum(t, en);
      printf("%d\n", answer);
    }
  }
  return 0;
}
