#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
const int N = 1 << 18;
int ta[2 * N];
int tb[2 * N];
inline int geta(int l, int r) {
  l += N;
  r += N;
  int res = 0;
  while (l <= r) {
    if ((l & 1)) res += ta[l];
    if (!(r & 1)) res += ta[r];
    l = (l + 1) >> 1;
    r = (r - 1) >> 1;
  }
  return res;
}
inline int getb(int l, int r) {
  l += N;
  r += N;
  int res = 0;
  while (l <= r) {
    if ((l & 1)) res += tb[l];
    if (!(r & 1)) res += tb[r];
    l = (l + 1) >> 1;
    r = (r - 1) >> 1;
  }
  return res;
}
int A, B;
void upda(int x, int v) {
  x += N;
  ta[x] = min(A, ta[x] + v);
  while (x > 1) {
    x >>= 1;
    ta[x] = ta[2 * x] + ta[2 * x + 1];
  }
}
void updb(int x, int v) {
  x += N;
  tb[x] = min(B, tb[x] + v);
  while (x > 1) {
    x >>= 1;
    tb[x] = tb[2 * x] + tb[2 * x + 1];
  }
}
int main() {
  int n, k, a, b, q;
  scanf("%d%d%d%d%d", &n, &k, &A, &B, &q);
  for (int i = 0; (i) < (q); ++i) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int d, a;
      scanf("%d%d", &d, &a);
      --d;
      upda(d, a);
      updb(d, a);
    } else {
      int p;
      scanf("%d", &p);
      --p;
      int res = getb(0, p - 1) + geta(p + k, n - 1);
      printf("%d\n", res);
    }
  }
  return 0;
}
