#include <bits/stdc++.h>
using namespace std;
long long ilA[3000000], ilB[3000000], A, B;
int n, dn, q, QT, a, b;
long long askA(int pp, int kp, int w = 1, int pw = 1, int kw = 262144) {
  if (pp == pw && kp == kw) return ilA[w];
  long long o = 0;
  int mid = (pw + kw) >> 1;
  if (pp <= mid) o += askA(pp, min(kp, mid), w * 2, pw, mid);
  if (kp > mid) o += askA(max(mid + 1, pp), kp, w * 2 + 1, mid + 1, kw);
  return o;
}
long long askB(int pp, int kp, int w = 1, int pw = 1, int kw = 262144) {
  if (pp == pw && kp == kw) return ilB[w];
  long long o = 0;
  int mid = (pw + kw) >> 1;
  if (pp <= mid) o += askB(pp, min(kp, mid), w * 2, pw, mid);
  if (kp > mid) o += askB(max(mid + 1, pp), kp, w * 2 + 1, mid + 1, kw);
  return o;
}
void add(int d, long long il, int w = 1, int pw = 1, int kw = 262144) {
  if (w >= 262144) {
    ilA[w] = min(A, ilA[w] + il);
    ilB[w] = min(B, ilB[w] + il);
  } else {
    int mid = (pw + kw) >> 1;
    if (d > mid)
      add(d, il, w * 2 + 1, mid + 1, kw);
    else
      add(d, il, w * 2, pw, mid);
    ilA[w] = ilA[w * 2] + ilA[w * 2 + 1];
    ilB[w] = ilB[w * 2] + ilB[w * 2 + 1];
  }
}
int main() {
  scanf("%d%d%I64d%I64d%d", &n, &dn, &A, &B, &q);
  for (int i = 0; i < q; i++) {
    scanf("%d", &QT);
    if (QT == 1) {
      scanf("%d%d", &a, &b);
      add(a, b);
    } else {
      long long odp = 0;
      scanf("%d", &a);
      if (a != 1) odp += askB(1, a - 1);
      if (a + dn <= n) odp += askA(a + dn, n);
      printf("%I64d\n", odp);
    }
  }
}
