#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const int maxn = 1e6 + 5;
struct fenwick {
  vector<int> v;
  int n;
  fenwick() {}
  fenwick(int n) {
    this->n = n;
    v.resize(n + 10, 0);
  }
  void incr(int i, int dx) {
    while (i <= n) {
      v[i] += dx;
      i += (i & -i);
    }
  }
  long long prefix(int i) {
    int cur = 0;
    while (i > 0) {
      cur += v[i];
      i -= (i & -i);
    }
    return cur;
  }
  long long suffix(int i) { return prefix(n) - prefix(i - 1); }
  long long get(int i) { return prefix(i) - prefix(i - 1); }
};
int n, k, a, b, q;
fenwick A, B;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> a >> b >> q;
  swap(a, b);
  b -= a;
  A = fenwick(n + 10);
  B = fenwick(n + 10);
  while (q--) {
    int typ;
    cin >> typ;
    if (typ == 1) {
      int d, dx;
      cin >> d >> dx;
      int cur = A.get(d);
      int easy = min(a - cur, dx);
      dx -= easy;
      int extra = B.get(d);
      dx = min(b - extra, dx);
      A.incr(d, easy);
      B.incr(d, dx);
    } else {
      int l;
      cin >> l;
      int r = l + k - 1;
      long long cur = A.prefix(l - 1) + A.suffix(r + 1) + B.suffix(r + 1);
      cout << cur << '\n';
    }
  }
  return 0;
}
