#include <bits/stdc++.h>
using namespace std;
struct FenwickTree {
  vector<int> ft;
  int n;
  int sum(int x) {
    int resp = 0;
    while (x > 0) {
      resp += ft[x];
      x -= (x) & (-x);
    }
    return resp;
  }
  void add(int pos, int val) {
    while (pos <= n) {
      ft[pos] += val;
      pos += (pos) & (-pos);
    }
  }
  int sum(int a, int b) {
    if (a > n) return 0;
    return sum(b) - sum(a - 1);
  }
  void set(int tam) {
    n = tam;
    ft.assign(4 * n, 0);
  }
};
int main() {
  int n, k, a, b, q;
  FenwickTree bef, aft;
  scanf("%d %d %d %d %d", &n, &k, &a, &b, &q);
  bef.set(n), aft.set(n);
  for (int i = 0; i < q; i++) {
    int x, y, z;
    scanf("%d", &x);
    if (x == 2) {
      scanf("%d", &y);
      int resp = 0;
      resp = bef.sum(y - 1) + aft.sum(y + k, n);
      printf("%d\n", resp);
    } else {
      scanf("%d %d", &y, &z);
      int aux1 = bef.sum(y, y);
      int aux2 = aft.sum(y, y);
      bef.add(y, min(z, b - aux1));
      aft.add(y, min(z, a - aux2));
    }
  }
  return 0;
}
