#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
struct Fenwick {
  long long fen[N];
  void clear() { memset(fen, 0, sizeof fen); }
  void ad(int p, long long val) {
    for (p++; p < N; p += p & -p) fen[p] += val;
  }
  long long gt(int p, long long ret = 0) {
    for (; p; p -= p & -p) ret += fen[p];
    return ret;
  }
};
long long n, k, a, b, q;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  Fenwick A, B;
  A.clear();
  B.clear();
  cin >> n >> k >> a >> b >> q;
  for (int i = 0; i < q; ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      long long d, c;
      cin >> d >> c;
      long long x1 = A.gt(d + 1) - A.gt(d);
      long long x2 = B.gt(d + 1) - B.gt(d);
      A.ad(d, -x1);
      B.ad(d, -x2);
      x1 += c;
      x2 += c;
      A.ad(d, min(x1, a));
      B.ad(d, min(x2, b));
    } else {
      long long p;
      cin >> p;
      long long ans = 0;
      ans += B.gt(p);
      ans += A.gt(n + 1) - A.gt(p + k);
      cout << ans << "\n";
    }
  }
  return 0;
}
