#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
template <class T>
class segtree {
  void build(int node, int ss, int se) {
    if (se - ss == 1) {
      tree[node] = arr[ss];
      return;
    }
    int m = (ss + se + 1) / 2;
    build(2 * node + 1, ss, m);
    build(2 * node + 2, m, se);
    tree[node] = f(tree[2 * node + 1], tree[2 * node + 2]);
  }
  void update(int node, int ss, int se, int dex, T val) {
    if (ss == dex && se == dex + 1) {
      tree[node] = val;
      arr[dex] = val;
      return;
    }
    int m = (ss + se + 1) / 2;
    if (dex < m)
      update(2 * node + 1, ss, m, dex, val);
    else
      update(2 * node + 2, m, se, dex, val);
    tree[node] = f(tree[2 * node + 1], tree[2 * node + 2]);
  }
  T query(int node, int ss, int se, int i, int j) {
    if (j <= ss || se <= i) return id;
    if (i <= ss && se <= j) return tree[node];
    int m = (ss + se + 1) / 2;
    return f(query(2 * node + 2, m, se, i, j),
             query(2 * node + 1, ss, m, i, j));
  }

 public:
  int n;
  T* tree;
  T* arr;
  T (*f)(T, T);
  T id;
  segtree(T* a, int nn, T (*func)(T, T), T i) {
    n = nn;
    arr = a;
    tree = new T[4 * n];
    f = func;
    id = i;
    build(0, 0, n);
  }
  void update(int dex, T val) { update(0, 0, n, dex, val); }
  T query(int i, int j) {
    if (j < 1 || i >= n) return id;
    return query(0, 0, n, i, j);
  }
};
long long add(long long a, long long b) { return a + b; }
long long min(long long a, long long b) { return a > b ? b : a; }
int main() {
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  long long* ar = new long long[n];
  for (int i = 0; i < n; i++) ar[i] = 0;
  segtree<long long> stb(ar, n, add, 0);
  long long* ar2 = new long long[n];
  for (int i = 0; i < n; i++) ar2[i] = 0;
  segtree<long long> sta(ar2, n, add, 0);
  for (int i = 0; i < q; i++) {
    int cmd;
    cin >> cmd;
    ;
    if (cmd == 1) {
      int d;
      cin >> d;
      ;
      int x;
      cin >> x;
      ;
      ;
      d--;
      stb.update(d, min(b, stb.arr[d] + x));
      sta.update(d, min(a, sta.arr[d] + x));
    } else {
      int d;
      cin >> d;
      ;
      d--;
      cout << stb.query(0, d) + sta.query(d + k, n) << "\n";
    }
  }
}
