#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int N = 2 * (int)1e5 + 5;
const long long inf = (long long)1e18;
int x[N], y[N];
int bit[2][N];
int n, k, a, b, q;
void upd(int q, int i, int val) {
  while (i <= n) {
    bit[q][i] += val;
    i += i & -i;
  }
}
int sum(int q, int i) {
  int s = 0;
  while (i > 0) {
    s += bit[q][i];
    i -= i & -i;
  }
  return s;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int d, val;
      cin >> d >> val;
      int nx = min(b, x[d] + val);
      int ny = min(a, y[d] + val);
      upd(0, d, nx - x[d]);
      upd(1, d, ny - y[d]);
      x[d] = nx;
      y[d] = ny;
    } else {
      int p;
      cin >> p;
      int ans = sum(0, p - 1);
      ans += sum(1, n) - sum(1, p + k - 1);
      cout << ans << endl;
    }
  }
}
