#include <bits/stdc++.h>
int n, k, a[2], q, bit[2][200005], op, d, x;
int sum(int m, bool b) {
  int s = 0;
  for (int r = m; r; r -= r & -r) s += bit[b][r];
  return s;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, a, a + 1, &q);
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &op, &d);
    if (op == 1) {
      scanf("%d", &op);
      for (int j = 0; j < 2; j++) {
        x = sum(d, j) - sum(d - 1, j);
        op = op + x > a[j] ? a[j] - x : op;
        for (int r = d; r <= n; r += r & -r) bit[j][r] += op;
      }
    } else
      printf("%d\n", sum(d - 1, 1) + sum(n, 0) - sum(d + k - 1, 0));
  }
  return 0;
}
