#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5, oo = 0x3f3f3f3f;
int bita[maxn], bitb[maxn], cnt[maxn];
int n;
int suma(int i) {
  int ans = 0;
  while (i) {
    ans += bita[i];
    i -= i & -i;
  }
  return ans;
}
int sumb(int i) {
  int ans = 0;
  while (i) {
    ans += bitb[i];
    i -= i & -i;
  }
  return ans;
}
void adda(int i, int x) {
  while (i <= n) {
    bita[i] += x;
    i += i & -i;
  }
}
void addb(int i, int x) {
  while (i <= n) {
    bitb[i] += x;
    i += i & -i;
  }
}
int main(void) {
  int k, a, b, q;
  scanf("%d", &(n));
  scanf("%d", &(k));
  scanf("%d", &(a));
  scanf("%d", &(b));
  scanf("%d", &(q));
  int aa, d;
  int ans = 0;
  for (int i = 0; i < q; i++) {
    int type;
    scanf("%d", &(type));
    if (type == 1) {
      scanf("%d%d", &d, &aa);
      adda(d, -min(cnt[d], a));
      addb(d, -min(cnt[d], b));
      cnt[d] += aa;
      adda(d, min(cnt[d], a));
      addb(d, min(cnt[d], b));
    } else {
      scanf("%d", &(d));
      ans += sumb(d - 1) + suma(n) - suma(d + k - 1);
      printf("%d\n", ans);
      ans = 0;
    }
  }
  return 0;
}
