#include <bits/stdc++.h>
const int mx = 1e6 + 5;
const int inf = 0x3f3f3f3f;
using namespace std;
template <class T, class T2>
class SegTree {
 private:
  int n, a, b;
  vector<T> tree;
  void update(int pos, int i, int j, int x, T2 value) {
    int esq = 2 * pos;
    int dir = 2 * pos + 1;
    int mid = (i + j) / 2;
    if (i == j) {
      tree[pos].first = min(b, tree[pos].first + value);
      tree[pos].second = min(a, tree[pos].second + value);
    } else {
      if (x <= mid)
        update(esq, i, mid, x, value);
      else
        update(dir, mid + 1, j, x, value);
      tree[pos].first = tree[esq].first + tree[dir].first;
      tree[pos].second = tree[esq].second + tree[dir].second;
    }
  }
  T query(int pos, int i, int j, int l, int r) {
    int esq = 2 * pos;
    int dir = 2 * pos + 1;
    int mid = (i + j) / 2;
    T ret;
    if (j < l || i > r)
      ret = {0, 0};
    else if (i >= l && j <= r)
      ret = tree[pos];
    else {
      T left = query(esq, i, mid, l, r), right = query(dir, mid + 1, j, l, r);
      ret.first = left.first + right.first;
      ret.second = left.second + right.second;
    }
    return ret;
  }

 public:
  SegTree(int size, int x, int y) {
    n = size + 1;
    a = x;
    b = y;
    tree.resize(4 * n, {0, 0});
  }
  T qry(int l, int r) { return query(1, 0, n - 1, l, r); }
  void upd(int x, T2 val) { update(1, 0, n - 1, x, val); }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k, a, b, q;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  SegTree<pair<int, int>, int> st(n, a, b);
  int t;
  while (q--) {
    scanf("%d", &t);
    if (t == 1) {
      int d, x;
      scanf("%d%d", &d, &x);
      st.upd(d, x);
    } else {
      int p;
      scanf("%d", &p);
      printf("%d\n", st.qry(0, p - 1).first + st.qry(p + k, n).second);
    }
  }
  return 0;
}
