#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 2e5;
int16_t x[N + 1], y[N + 1];
int32_t n, tx[N + 1], ty[N + 1];
void add(int32_t* t, int i, int d) {
  for (; i <= n; i += i & -i) t[i] += d;
}
int sum(int32_t* t, int i) {
  int ans = 0;
  for (; i > 0; i -= i & -i) ans += t[i];
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  int k, a, b, q, t, d, dx, dy, p;
  cin >> n >> k >> a >> b >> q;
  while (q-- > 0) {
    cin >> t;
    if (t == 1) {
      cin >> d >> dx;
      dx = min(x[d] + dx, a) - x[d];
      dy = min(y[d] + dx, b) - y[d];
      x[d] += dx;
      y[d] += dy;
      add(tx, d, dx);
      add(ty, d, dy);
    } else {
      cin >> p;
      cout << sum(tx, n) - sum(tx, p + k - 1) + sum(ty, p - 1) << '\n';
    }
  }
  return 0;
}
