#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 201000;
int n, k, a, b, q, ty, d, v, r[N];
struct bit {
  int c[N];
  int query(int x) {
    int s = 0;
    for (; x; x -= x & -x) s += c[x];
    return s;
  }
  void modify(int x, int s) {
    for (; x <= n; x += x & -x) c[x] += s;
  }
} c1, c2;
int main() {
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  for (int i = 0; i < q; i++) {
    scanf("%d", &ty);
    if (ty == 1) {
      scanf("%d%d", &d, &v);
      c1.modify(d, -min(r[d], b));
      c2.modify(n - d + 1, -min(r[d], a));
      r[d] += v;
      c1.modify(d, min(r[d], b));
      c2.modify(n - d + 1, min(r[d], a));
    } else {
      scanf("%d", &d);
      printf("%d\n", c1.query(d - 1) + c2.query(n - d - k + 1));
    }
  }
}
