#include <bits/stdc++.h>
using namespace std;
long long update(vector<long long> &tree, int index, int a, int b, int x,
                 long long value) {
  if (x >= a and x < b) {
    if (a == b - 1)
      tree[index] = value;
    else
      tree[index] = update(tree, 2 * index, a, (a + b) / 2, x, value) +
                    update(tree, 2 * index + 1, (a + b) / 2, b, x, value);
  }
  return tree[index];
}
long long get(vector<long long> &tree, int index, int a, int b, int l, int r) {
  if (r <= a or l >= b) return 0;
  if (l <= a and r >= b) return tree[index];
  return get(tree, 2 * index, a, (a + b) / 2, l, r) +
         get(tree, 2 * index + 1, (a + b) / 2, b, l, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, k, a, b, q, tot = 1;
  cin >> n >> k >> a >> b >> q;
  while (tot < n) tot *= 2;
  tot *= 2;
  vector<long long> treea(tot, 0), treeb(tot, 0);
  for (int i = 0; i < q; i++) {
    long long t, di, ai;
    cin >> t;
    if (t == 1) {
      cin >> di >> ai;
      int newv = min(a, treea[tot / 2 + di - 1] + ai);
      update(treea, 1, 0, tot / 2, di - 1, newv);
      newv = min(b, treeb[tot / 2 + di - 1] + ai);
      update(treeb, 1, 0, tot / 2, di - 1, newv);
    } else if (t == 2) {
      cin >> di;
      cout << get(treeb, 1, 0, tot / 2, 0, di - 1) +
                  get(treea, 1, 0, tot / 2, di + k - 1, tot / 2)
           << endl;
    }
  }
}
