#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000000 + 7;
long long n, k, a, b, q;
vector<long long> tree_min, tree_max, arr;
long long getSum(vector<long long> &tree, long long index) {
  long long sum = 0;
  while (index > 0) {
    sum += tree[index];
    index -= index & (-index);
  }
  return sum;
}
void update(vector<long long> &tree, long long index, long long value) {
  while (index <= n) {
    tree[index] += value;
    index += index & (-index);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k >> a >> b >> q;
  tree_max.resize(n + 1, 0);
  tree_min.resize(n + 1, 0);
  arr.resize(n + 1, 0);
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      long long index, value;
      cin >> index >> value;
      if (arr[index] < b) {
        if (arr[index] + value >= b)
          update(tree_min, index, max((long long)0, b - arr[index]));
        else
          update(tree_min, index, value);
      }
      if (arr[index] < a) {
        if (arr[index] + value >= a)
          update(tree_max, index, max((long long)0, a - arr[index]));
        else
          update(tree_max, index, value);
      }
      arr[index] += value;
    } else if (t == 2) {
      long long index;
      cin >> index;
      long long b_sum = getSum(tree_min, index - 1);
      long long a_sum =
          getSum(tree_max, n) - getSum(tree_max, min(n, index + k - 1));
      cout << a_sum + b_sum << endl;
    }
  }
  return 0;
}
