#include <bits/stdc++.h>
using namespace std;
template <class T>
struct fenwick {
  vector<T> tree;
  int n;
  fenwick(int n) : n(n) { tree.resize(n + 1); }
  void update(int a, T val) {
    for (; a <= n; a += a & -a) {
      tree[a] += val;
    }
  }
  T query(int a) {
    T res = 0;
    for (; a > 0; a -= a & -a) {
      res += tree[a];
    }
    return res;
  }
  int lower_bound(T k) {
    int res = 0;
    T cur = 0;
    for (int i = 31 - __builtin_clz(n); i >= 0; --i) {
      if (res + (1 << i) <= n && cur + tree[res + (1 << i)] < k) {
        res += 1 << i;
        cur += tree[res];
      }
    }
    return res + 1;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  fenwick<int> before(n), after(n);
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int x, y;
      cin >> x >> y;
      before.update(x, min(b - before.query(x) + before.query(x - 1), y));
      after.update(x, min(a - after.query(x) + after.query(x - 1), y));
    } else {
      int p;
      cin >> p;
      cout << before.query(p - 1) + after.query(n) - after.query(p + k - 1)
           << "\n";
    }
  }
}
