#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
class Problem {
 public:
  int n, k, a, b, q;
  int L;
  vector<pair<int, int> > tr;
  void solve() {
    cin >> n >> k >> a >> b >> q;
    n++;
    L = (int)log2(n);
    if (1 << L < n) L++;
    tr.resize(1 << (L + 1));
    for (int i = (int)(0); i < (int)(q); ++i) {
      int o, d, ai, p;
      cin >> o;
      if (o == 1) {
        cin >> d >> ai;
        upd(1, 0, n - 1, d, ai);
      } else {
        cin >> p;
        pair<int, int> p1 = query(1, 0, n - 1, 0, p - 1);
        pair<int, int> p2 = query(1, 0, n - 1, p + k, n - 1);
        int res = p1.second + p2.first;
        cout << res << "\n";
      }
    }
  }
  void upd(int u, int l, int r, int i, int v) {
    if (l > i || r < i) return;
    if (l == r) {
      pair<int, int> v1 = tr[u];
      v1.first += v, v1.second += v;
      tr[u] = pair<int, int>(min(a, v1.first), min(b, v1.second));
      return;
    }
    int m = (l + r) / 2;
    upd(2 * u, l, m, i, v);
    upd(2 * u + 1, m + 1, r, i, v);
    pair<int, int> pl = tr[2 * u], pr = tr[2 * u + 1];
    pair<int, int> p;
    p.first = pl.first + pr.first;
    p.second = pl.second + pr.second;
    tr[u] = p;
  }
  pair<int, int> query(int u, int l, int r, int i, int j) {
    if (l > j || r < i) return pair<int, int>(0, 0);
    if (i <= l && r <= j) {
      return tr[u];
    }
    int m = (l + r) / 2;
    pair<int, int> ql = query(2 * u, l, m, i, j);
    pair<int, int> qr = query(2 * u + 1, m + 1, r, i, j);
    pair<int, int> q = ql;
    q.first += qr.first;
    q.second += qr.second;
    return q;
  }
  void print_tree() {
    cout << "tree: " << endl;
    for (int l = (int)(0); l <= (int)(L); ++l) {
      int s = 1 << l, e = 2 * s - 1;
      for (int i = (int)(s); i <= (int)(e); ++i)
        printf("(%d, %d) ", tr[i].first, tr[i].second);
      cout << endl;
    }
  }
};
int main() {
  int test_cases = 1;
  ios::sync_with_stdio(false);
  for (int test_case = (int)(0); test_case < (int)(test_cases); ++test_case) {
    Problem p;
    p.solve();
  }
  return 0;
}
