#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N], b[N], c[N];
int lowbit(int x) { return x & (-x); }
long long aa, bb;
int n;
void add(int x, long long y) {
  for (int i = x; i <= n; i += lowbit(i)) {
    a[i] += max(0LL, min(aa - c[x], y));
    b[i] += max(0LL, min(bb - c[x], y));
  }
}
long long get(long long *A, int x) {
  long long ans = 0;
  for (int i = x; i; i -= lowbit(i)) {
    ans += A[i];
  }
  return ans;
}
int main() {
  int k, q;
  while (~scanf("%d%d%I64d%I64d%d", &n, &k, &bb, &aa, &q)) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    for (int i = 0; i < q; i++) {
      int p;
      scanf("%d", &p);
      if (p == 1) {
        int x, y;
        scanf("%d%d", &x, &y);
        add(x, y);
        c[x] += y;
      } else {
        int x;
        scanf("%d", &x);
        long long ans = get(a, x - 1) + get(b, n) - get(b, min(n, x + k - 1));
        printf("%I64d\n", ans);
      }
    }
  }
  return 0;
}
