#include <bits/stdc++.h>
const int MAX_LEN = 1010;
using namespace std;
template <typename U, typename V>
string to_string(pair<U, V>);
string to_string(const string& e_) { return "\"" + e_ + "\""; }
string to_string(char e_) { return "\'" + string(1, e_) + "\'"; }
string to_string(bool e_) { return e_ ? "true" : "false"; }
template <typename T>
string to_string(T e_) {
  string s_ = "[ ";
  for (const auto& x_ : e_) s_ += to_string(x_) + " ";
  return s_ + "]";
}
template <typename U, typename V>
string to_string(pair<U, V> e_) {
  return "(" + to_string(e_.first) + ", " + to_string(e_.second) + ")";
}
void dbg_str() { ; }
template <typename U, typename... V>
void dbg_str(U u, V... v) {
  ;
  dbg_str(v...);
}
class FenwickTree {
 private:
  vector<int> ft;

 public:
  FenwickTree() {}
  FenwickTree(int n) { ft.assign(n + 1, 0); }
  int rsq(int b) {
    int sum = 0;
    for (; b; b -= (b & (-b))) sum += ft[b];
    return sum;
  }
  int rsq(int a, int b) { return rsq(b) - (a == 1 ? 0 : rsq(a - 1)); }
  void adjust(int k, int v) {
    for (; k < (int)ft.size(); k += (k & (-k))) ft[k] += v;
  }
};
const int N = 200100;
int n, k, a, b, q, t, dx, ax, px;
int xx[N], yy[N];
int main() {
  scanf("%d %d %d %d %d", &n, &k, &a, &b, &q);
  FenwickTree A(N);
  FenwickTree B(N);
  for (int i = 0; i < q; i++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d %d", &dx, &ax);
      int lx = ax;
      if (xx[dx] < b) {
        if (xx[dx] + ax > b) ax = b - xx[dx];
        xx[dx] += ax;
        A.adjust(dx, ax);
      }
      ax = lx;
      if (yy[dx] < a) {
        ;
        if (yy[dx] + ax > a) ax = a - yy[dx];
        yy[dx] += ax;
        ;
        B.adjust(n - dx + 1, ax);
      }
    } else {
      for (int i = 1; i <= n; i++)
        ;
      ;
      for (int i = 1; i <= n; i++)
        ;
      ;
      scanf("%d", &px);
      ;
      printf("%d\n", A.rsq(px - 1) + B.rsq(n - (px + k) + 1));
    }
  }
}
