#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long M = 1e9 + 7;
template <typename T>
void print(vector<T>& v) {
  cout << "[";
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i];
    if (i != v.size() - 1) cout << ", ";
  }
  cout << "]\n";
}
template <typename T>
void print(set<T>& v) {
  cout << "[";
  for (auto it : v) {
    cout << it;
    if (it != *v.rbegin()) cout << ", ";
  }
  cout << "]\n";
}
template <typename T, typename S>
void print(map<T, S>& v) {
  for (auto it : v) cout << it.first << " : " << it.second << "\n";
}
template <typename T, typename S>
void print(pair<T, S>& v) {
  cout << "( " << v.first << ", " << v.second << " )" << '\n';
}
template <typename T>
void print(T x) {
  cout << x << '\n';
}
const int maxn = 200010;
int n, k, a, b, q;
struct FenwickTree {
  vector<long long> bit;
  int n;
  FenwickTree(int n) {
    this->n = n;
    bit.assign(n, 0);
  }
  FenwickTree(vector<long long>& a) : FenwickTree(a.size()) {
    for (size_t i = 0; i < a.size(); i++) add(i, a[i]);
  }
  long long sum(int r) {
    long long ret = 0;
    for (; r >= 0; r = (r & (r + 1)) - 1) ret += bit[r];
    return ret;
  }
  long long sum(int l, int r) {
    if (l > r) return 0ll;
    return sum(r) - sum(l - 1);
  }
  void add(int idx, long long delta) {
    for (; idx < n; idx = idx | (idx + 1)) bit[idx] += delta;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k >> a >> b >> q;
  FenwickTree f1 = FenwickTree(n), f2 = FenwickTree(n);
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int d, ad;
      cin >> d >> ad;
      d--;
      f1.add(d, ad);
      f2.add(d, ad);
      long long s1 = f1.sum(d, d);
      if (s1 > a) {
        f1.add(d, -s1 + a);
      }
      long long s2 = f2.sum(d, d);
      if (s2 > b) {
        f2.add(d, -s2 + b);
      }
    } else {
      int p;
      cin >> p;
      p--;
      long long ans = f2.sum(0, p - 1) + f1.sum(p + k, n - 1);
      cout << ans << '\n';
    }
  }
}
