#include <bits/stdc++.h>
using namespace std;
const int nax = 200010;
int n;
int s[2][nax];
int x[nax], y[nax];
inline void add(int q, int i, int d) {
  for (; i <= n; i += i & (-i)) {
    s[q][i] += d;
  }
}
int sum(int q, int i) {
  int ans = 0;
  for (; i > 0; i -= i & (-i)) {
    ans += s[q][i];
  }
  return ans;
}
int main() {
  int k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  for (int i = 0; i < q; i++) {
    int type;
    cin >> type;
    if (type == 1) {
      int d, upd;
      cin >> d >> upd;
      int addx = min(b, x[d] + upd);
      int addy = min(a, y[d] + upd);
      add(0, d, addx - x[d]);
      add(1, d, addy - y[d]);
      x[d] = addx;
      y[d] = addy;
    }
    if (type == 2) {
      int res = 0;
      int c;
      cin >> c;
      res = sum(0, c - 1);
      res += sum(1, n) - sum(1, c + k - 1);
      cout << res << "\n";
    }
  }
  return 0;
}
