#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long n, long long temp) {
  long long res = 1, y = a;
  while (n > 0) {
    if (n & 1) res = (res * y) % temp;
    y = (y * y) % temp;
    n /= 2;
  }
  return res % temp;
}
long long ison(long long mask, long long pos) { return (mask & (1 << pos)); }
long long cbit(long long n) {
  long long k = 0;
  while (n) n &= (n - 1), k++;
  return k;
}
long long nbit(long long n) {
  long long k = 0;
  while (n) n /= 2, k++;
  return k;
}
long long mod = 1e9 + 7;
int sgn(long long x) { return x < 0 ? -1 : !!x; }
long long c[200005];
long long d[200005];
long long bit[500005], n, bit2[500005];
void upd(long long ind, long long val) {
  if (ind == 0) return;
  while (ind <= n) {
    bit[ind] += val;
    ind += (ind & -ind);
  }
}
long long qu(long long ind) {
  long long k = 0;
  while (ind > 0) {
    k += bit[ind];
    ind -= (ind & -ind);
  }
  return k;
}
void upd2(long long ind, long long val) {
  if (ind == 0) return;
  while (ind <= n) {
    bit2[ind] += val;
    ind += (ind & -ind);
  }
}
long long qu2(long long ind) {
  long long k = 0;
  while (ind > 0) {
    k += bit2[ind];
    ind -= (ind & -ind);
  }
  return k;
}
long long xo(long long i) {
  if ((i & 3) == 0) return i;
  if ((i & 3) == 1) return 1;
  if ((i & 3) == 2) return i + 1;
  return 0;
}
int main() {
  long long k, a, b, l, r, t, i, q;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    cin >> t;
    if (t == 1) {
      long long d1, d2;
      cin >> d1 >> d2;
      long long x1 = min(b, c[d1] + d2);
      long long x2 = min(a, d[d1] + d2);
      upd(d1, x1 - c[d1]);
      upd2(d1, x2 - d[d1]);
      c[d1] = x1;
      d[d1] = x2;
    } else {
      long long r1;
      cin >> r1;
      long long ans = 0;
      ans += qu(r1 - 1);
      ans += (qu2(n) - qu2(r1 + k - 1));
      cout << ans << endl;
    }
  }
}
