#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795l;
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 200100;
struct Input {
  int n, k;
  int A, B, q;
  int d[N], c[N];
  int p[N];
  int tp[N];
  bool read() {
    if (scanf("%d%d", &n, &k) != 2) return 0;
    cin >> A >> B >> q;
    for (int i = int(0); i < int(q); ++i) {
      scanf("%d", &tp[i]);
      if (tp[i] == 1) {
        scanf("%d%d", &d[i], &c[i]);
        d[i]--;
      } else {
        scanf("%d", &p[i]);
        p[i]--;
      }
    }
    return 1;
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  vector<long long> ans;
  void write() {
    for (int i = int(0); i < int(((int)(ans).size())); ++i) {
      cout << ans[i] << endl;
    }
  }
  virtual void solve() {}
  virtual void clear() { *this = Data(); }
};
struct seg_tree {
  vector<int> t;
  int sz;
  seg_tree(int n) {
    sz = 1;
    while (sz < n) sz <<= 1;
    t.assign(2 * sz, 0);
  }
  int fnd(int i, int x, int y, int l, int r) {
    if (x > r || y < l) return 0;
    if (x >= l && y <= r) return t[i];
    return fnd(2 * i, x, (x + y) >> 1, l, r) +
           fnd(2 * i + 1, ((x + y) >> 1) + 1, y, l, r);
  }
  void upd(int v, int k, int c) {
    int add = min(c, max(0, k - t[v + sz]));
    v += sz;
    while (v > 0) {
      t[v] += add;
      v >>= 1;
    }
  }
};
struct Solution : Data {
  void solve() {
    seg_tree a(n), b(n);
    for (int i = int(0); i < int(q); ++i) {
      if (tp[i] == 1) {
        a.upd(d[i], A, c[i]);
        b.upd(d[i], B, c[i]);
      } else {
        int res = 0;
        if (p[i] > 0) {
          res += b.fnd(1, 0, b.sz - 1, 0, p[i] - 1);
        }
        if (p[i] + k < n) {
          res += a.fnd(1, 0, a.sz - 1, p[i] + k, n - 1);
        }
        ans.push_back(res);
      }
    }
  }
  void clear() { *this = Solution(); }
};
Solution sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
