#include <bits/stdc++.h>
using namespace std;
int xa[200005] = {};
int xb[200005] = {};
int order[200005] = {};
int n, k, a, b, q;
void update(int day, int val) {
  int x = day;
  int v1, v2;
  v1 = min(val, a - order[day]);
  v2 = min(val, b - order[day]);
  if (v1 < 0) v1 = 0;
  if (v2 < 0) v2 = 0;
  for (; x <= n; x += x & -x) {
    xa[x] += v1;
    xb[x] += v2;
  }
}
int sum(int end, int *temp) {
  int sum = 0;
  for (; end > 0; end -= end & -end) {
    sum += temp[end];
  }
  return sum;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  for (int zz = 0; zz < q; zz++) {
    int qn;
    cin >> qn;
    if (qn == 1) {
      int day, upord;
      cin >> day >> upord;
      update(day, upord);
      order[day] += upord;
    } else {
      int qday;
      cin >> qday;
      cout << sum(qday - 1, xb) + (sum(n, xa) - sum(qday + k - 1, xa)) << endl;
    }
  }
}
