#include <bits/stdc++.h>
using namespace std;
const int unu = 1;
const int doi = 2;
const int nmax = 200005;
long long aib[4][nmax];
int n, a, b, k, q;
void update(int tip, int pos, int val) {
  for (; pos <= n; pos += (pos & (-pos))) {
    aib[tip][pos] += 1LL * val;
  }
}
long long query(int tip, int pos) {
  long long sum = 0;
  for (; pos; pos -= (pos & (-pos))) {
    sum += aib[tip][pos];
  }
  return sum;
}
long long getSum(int tip, int x, int y) {
  long long ans = query(tip, y) - query(tip, x - 1);
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k >> a >> b >> q;
  for (int i = 1; i <= q; ++i) {
    int tip, di, ai;
    cin >> tip;
    if (tip == 1) {
      cin >> di >> ai;
      long long amdeja1 = getSum(1, di, di);
      long long amdeja2 = getSum(2, di, di);
      long long maiPotPune1 = b - amdeja1;
      long long maiPotPune2 = a - amdeja2;
      long long punAcum1 = min(ai, b);
      long long punAcum2 = min(ai, a);
      update(unu, di, min(maiPotPune1, punAcum1));
      update(doi, di, min(maiPotPune2, punAcum2));
    } else {
      int pi;
      cin >> pi;
      long long ans = getSum(unu, 1, pi - 1) + getSum(doi, pi + k, n);
      cout << ans << "\n";
    }
  }
  return 0;
}
