#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100000009;
long long N, K, A, B, Q, X, Y, OP, P, ans = 0;
class SegmentTree {
 private:
  long long n;
  vector<pair<long long, long long> > t;
  pair<long long, long long> combine(pair<long long, long long> a,
                                     pair<long long, long long> b) {
    return pair<long long, long long>(a.first + b.first, a.second + b.second);
  }

 public:
  SegmentTree(long long N) {
    n = N;
    t.assign(n << 1, pair<long long, long long>(0, 0));
  }
  void modify(long long p, long long val) {
    p += n;
    t[p].first = min(B, t[p].first + val);
    t[p].second = min(A, t[p].second + val);
    for (; p >>= 1;) t[p] = combine(t[p << 1], t[p << 1 | 1]);
  }
  pair<long long, long long> query(long long L, long long R) {
    pair<long long, long long> ret = pair<long long, long long>(0, 0);
    for (L += n, R += n; L < R; L >>= 1, R >>= 1) {
      if (L & 1) ret = combine(t[L++], ret);
      if (R & 1) ret = combine(ret, t[--R]);
    }
    return ret;
  }
  long long debugger() {
    for (int i = 0; i < (N << 1); i++) {
      cout << t[i].first << " " << t[i].second << endl;
    }
    return 0;
  }
};
int main() {
  scanf("%I64d %I64d %I64d %I64d %I64d", &N, &K, &A, &B, &Q);
  SegmentTree st(N);
  for (int i = 0; i < Q; i++) {
    scanf("%I64d", &OP);
    if (OP == 1) {
      scanf("%I64d %I64d", &X, &Y);
      X--;
      st.modify(X, Y);
    }
    if (OP == 2) {
      scanf("%I64d", &P);
      P--;
      ans = st.query(0, P).first + st.query(P + K, N).second;
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
