#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
inline void priv(vector<int> a) {
  for (int i = 0; i < ((int)(a).size()); ++i)
    printf("%d%c", a[i], i == (int)(a).size() - 1 ? '\n' : ' ');
}
template <typename T>
istream& operator>>(istream& i, vector<T>& v) {
  for (T& x : v) i >> x;
  return i;
}
template <typename T>
string join(vector<T>& v) {
  stringstream s;
  for (T& x : v) s << ' ' << x;
  return s.str().substr(1);
}
template <typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
  if ((int)(v).size()) o << join(v);
  return o;
}
const int MX = 200005, INF = 1001001001;
const long long int LINF = 1e18;
const double eps = 1e-10;
int n, m, a, b, q;
int s[MX];
struct bit {
  vector<int> d;
  int n;
  bit() {}
  bit(int mx) : n(mx), d(mx) {}
  void add(int i, int x = 1) {
    for (++i; i < n; i += i & -i) d[i] += x;
  }
  int sum(int i) {
    int x = 0;
    for (++i; i; i -= i & -i) x += d[i];
    return x;
  }
};
int main() {
  scanf("%d%d%d%d%d", &n, &m, &a, &b, &q);
  bit d1(MX), d2(MX);
  for (int qi = 0; qi < (q); ++qi) {
    int ty;
    scanf("%d", &ty);
    if (ty == 1) {
      int x, p;
      scanf("%d%d", &p, &x);
      int ps = s[p];
      s[p] += x;
      {
        int px = min(ps, b);
        int nx = min(s[p], b);
        d1.add(p, nx - px);
      }
      {
        int px = min(ps, a);
        int nx = min(s[p], a);
        d2.add(p, nx - px);
      }
    } else {
      int p;
      scanf("%d", &p);
      int ans = d1.sum(p - 1) + (d2.sum(n) - d2.sum(p + m - 1));
      printf("%d\n", ans);
    }
  }
  return 0;
}
