#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = (1 << 30) - 1;
const int MAXN = 400010;
const long long mod = 1e9 + 7;
long long n, k, a, b, q;
long long c[2][MAXN];
void Update(int x, long long d, int id) {
  while (x <= n) {
    c[id][x] += d;
    x += x & (-x);
  }
}
long long Getsum(int x, int id) {
  long long res = 0;
  while (x) {
    res += c[id][x];
    x -= x & (-x);
  }
  return res;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  for (int i = 1; i <= q; ++i) {
    long long f, A, B, C;
    scanf("%I64d", &f);
    if (f == 1) {
      scanf("%I64d%I64d", &A, &B);
      long long res1 = Getsum(A, 0) - Getsum(A - 1, 0);
      if (res1 < b) {
        Update(A, -res1, 0);
        Update(A, min(b, B + res1), 0);
      }
      long long res2 = Getsum(A, 1) - Getsum(A - 1, 1);
      if (res1 < a) {
        Update(A, -res2, 1);
        Update(A, min(a, B + res2), 1);
      }
    } else {
      scanf("%I64d", &A);
      printf("%I64d\n", Getsum(A - 1, 0) + Getsum(n, 1) - Getsum(A + k - 1, 1));
    }
  }
  return 0;
}
