#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 100500;
const int maxn = 200500;
long long f1[maxn], f2[maxn];
void add(long long *f, int i, long long x) {
  if (x <= 0) return;
  for (; i < maxn; i |= (i + 1)) {
    f[i] += x;
  }
}
long long get(long long *f, int i) {
  long long s = 0;
  for (; i >= 0; i = (i & (i + 1)) - 1) {
    s += f[i];
  }
  return s;
}
int n, k, a, b, q;
int cur[maxn];
int main() {
  ios::sync_with_stdio(false);
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  for (int III = 0; III < (int)(q); ++III) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int pos, x;
      scanf("%d%d", &pos, &x);
      --pos;
      int old = cur[pos];
      int nxt = min(a, cur[pos] + x);
      cur[pos] = nxt;
      add(f1, pos, min(b, nxt) - min(b, old));
      add(f2, pos, nxt - old);
    } else {
      int pos;
      scanf("%d", &pos), --pos;
      long long r1 = pos == 0 ? 0 : get(f1, pos - 1);
      long long r2 = get(f2, n) - get(f2, pos + k - 1);
      cout << r1 + r2 << "\n";
    }
  }
  return 0;
}
