#include <bits/stdc++.h>
using namespace std;
long long Val[200010], TreeL[200010], TreeR[200010];
int main() {
  long long n, k, a, b, q;
  scanf("%lld%lld%lld%lld%lld", &n, &k, &a, &b, &q);
  for (long long i = 1; i <= q; i++) {
    long long op;
    scanf("%lld", &op);
    if (op == 1) {
      long long x, y;
      scanf("%lld%lld", &x, &y);
      long long s1 = min(Val[x] + y, b) - min(Val[x], b);
      for (long long i = x; i <= n; i += i & (-i)) TreeL[i] += s1;
      long long s2 = min(Val[x] + y, a) - min(Val[x], a);
      for (long long i = x; i; i -= i & (-i)) TreeR[i] += s2;
      Val[x] += y;
    } else {
      long long x, ans = 0;
      scanf("%lld", &x);
      for (long long i = x - 1; i; i -= i & (-i)) ans += TreeL[i];
      for (long long i = x + k; i <= n; i += i & (-i)) ans += TreeR[i];
      printf("%lld\n", ans);
    }
  }
  return 0;
}
