#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, a, b, k, q, type;
int ft1[2 * N], ft2[2 * N];
void update(int d, int x, int y) {
  while (d <= n) {
    ft1[d] += x;
    ft2[d] += y;
    d += d & (-d);
  }
}
int query1(int p) {
  int ans = 0;
  while (p) {
    ans += ft1[p];
    p -= p & (-p);
  }
  return ans;
}
int query2(int p) {
  int ans = 0;
  while (p) {
    ans += ft2[p];
    p -= p & (-p);
  }
  return ans;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  int d, x;
  int arr1[N] = {0};
  int arr2[N] = {0};
  while (q--) {
    cin >> type;
    if (type == 1) {
      cin >> d >> x;
      update(d, min(x, b - arr1[d]), min(x, a - arr2[d]));
      arr1[d] += min(x, b - arr1[d]);
      arr2[d] += min(x, a - arr2[d]);
    } else {
      cin >> x;
      cout << query1(x - 1) + query2(n) - query2(x + k - 1) << "\n";
    }
  }
  return 0;
}
