#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
void minimize(X &x, const Y &y) {
  if (x > y) x = y;
}
template <class X, class Y>
void maximize(X &x, const Y &y) {
  if (x < y) x = y;
}
class FenwickTree {
 private:
  int n;
  vector<long long> v;
  long long get(int x) const {
    long long res = 0;
    for (; x >= 1; x &= x - 1) res += v[x];
    return (res);
  }

 public:
  FenwickTree() { n = 0; }
  FenwickTree(int n) {
    this->n = n;
    v.assign(n + 7, 0);
  }
  void update(int x, long long d) {
    for (; x <= n; x += x & -x) v[x] += d;
  }
  long long getSum(int l, int r) const { return (get(r) - get(l - 1)); }
};
int n, dur, low, high, q;
long long cnt[200200];
void init(void) { scanf("%d%d%d%d%d", &n, &dur, &high, &low, &q); }
void process(void) {
  FenwickTree lowBit(n), highBit(n);
  for (int love = 0, _n = (q); love < _n; love = love + 1) {
    int t, u, v;
    scanf("%d%d", &t, &u);
    if (t == 1) {
      scanf("%d", &v);
      long long oldLow = min(1LL * low, cnt[u]);
      long long oldHigh = min(1LL * high, cnt[u]);
      cnt[u] += v;
      long long curLow = min(1LL * low, cnt[u]);
      long long curHigh = min(1LL * high, cnt[u]);
      lowBit.update(u, curLow - oldLow);
      highBit.update(u, curHigh - oldHigh);
    } else
      cout << lowBit.getSum(1, u - 1) + highBit.getSum(u + dur, n) << "\n";
  }
}
int main(void) {
  init();
  process();
  return 0;
}
