#include <bits/stdc++.h>
using namespace std;
int arr[200005];
int arr2[200005];
int prev(int x) { return x & (x - 1); }
int next(int x) { return (x << 1) - prev(x); }
int find_sum(int x, int* arr) {
  int ret = 0;
  while (x) {
    ret += arr[x];
    x = prev(x);
  }
  return ret;
}
int find_sum(int l, int r, int* arr) {
  if (l > r) {
    return 0;
  }
  return find_sum(r, arr) - find_sum(l, arr);
}
void update(int x, int val, int* arr) {
  while (x < 200005) {
    arr[x] += val;
    x = next(x);
  }
}
int main() {
  int n, k, a, b, q;
  cin >> n >> k >> b >> a >> q;
  for (int i = 0; i < q; ++i) {
    int t;
    cin >> t;
    if (t == 1) {
      int x, y;
      cin >> x >> y;
      int v1 = find_sum(x - 1, x, arr);
      update(x, std::min(a - v1, y), arr);
      int v2 = find_sum(x - 1, x, arr2);
      update(x, std::min(b - v2, y), arr2);
    } else {
      int v;
      cin >> v;
      int ret = find_sum(0, v - 1, arr) + find_sum(v + k - 1, 200004, arr2);
      cout << ret << '\n';
    }
  }
  return 0;
}
