#include <bits/stdc++.h>
using namespace std;
const int N = 201000;
typedef struct day {
  long long nmax, sum;
  long long putit(long long x, long long v) {
    if (x + sum > v) {
      int t = v - sum;
      sum = v;
      return t;
    }
    sum += x;
    return x;
  }
} day;
typedef struct Fenwick_Tree {
  long long c[N];
  int siz;
  int init(int x) {
    for (int i = 0; i <= x + 1; i++) c[i] = 0;
    return siz = x;
  }
  int lowbit(int x) { return x & (-x); }
  inline int add(int x, long long t) {
    if (t == 0) return 0;
    for (; x <= siz; x += lowbit(x)) c[x] += t;
  }
  long long sum(int x) {
    long long ans = 0;
    for (; x; x -= lowbit(x)) ans += c[x];
    return ans;
  }
  long long intersum(int l, int r) {
    if (l > r) return 0;
    return sum(r) - sum(l - 1);
  }
} Fenwick;
Fenwick fa, fb;
day dxa[N], dxb[N];
int k, n, a, b, q;
int ty, d, x;
int main() {
  cin >> n >> k >> a >> b >> q;
  fa.init(n);
  fb.init(n);
  while (q--) {
    scanf("%d", &ty);
    if (ty == 1) {
      scanf("%d%d", &d, &x);
      fa.add(d, dxa[d].putit(x, a));
      fb.add(d, dxb[d].putit(x, b));
    } else {
      scanf("%d", &x);
      printf("%I64d\n", fb.intersum(1, x - 1) + fa.intersum(x + k, n));
    }
  }
}
