#include <bits/stdc++.h>
using namespace std;
class BIT {
  long long* _binary_index_tree;
  int _size_n;

 public:
  BIT(int size_n);
  BIT(int* arr, int len);
  int _lowbit(int pos);
  void _increase(int adder, int pos);
  long long _query(int pos);
  void _calcu(int pos, int* arr);
};
BIT::BIT(int size_n) {
  _binary_index_tree = (long long*)malloc(sizeof(long long) * (size_n + 1));
  for (int i = 0; i <= size_n; i++) {
    _binary_index_tree[i] = 0;
  }
  this->_size_n = size_n;
}
BIT::BIT(int* arr, int len) {
  _size_n = len;
  for (auto i = 0; i < _size_n; i++) {
    _calcu(i + 1, arr);
  }
}
int BIT::_lowbit(int pos) { return pos & (-pos); }
void BIT::_increase(int adder, int pos) {
  int tmp = pos;
  while (tmp <= _size_n) {
    _binary_index_tree[tmp] += adder;
    tmp += _lowbit(tmp);
  }
}
long long BIT::_query(int pos) {
  int tmp = pos;
  long long accumulator = 0;
  while (tmp > 0) {
    accumulator += _binary_index_tree[tmp];
    tmp -= _lowbit(tmp);
  }
  return accumulator;
}
void BIT::_calcu(int pos, int* arr) {
  int tmp = pos;
  tmp -= _lowbit(tmp);
  long long acc = _query(tmp);
  for (int i = tmp + 1; i <= pos; i++) {
    acc += arr[i];
  }
  _binary_index_tree[pos] = acc;
}
class Solution {
  vector<int> arr;
  int n, k, a, b, q;

 public:
  int MIN(int a, int b) {
    if (a < b)
      return a;
    else
      return b;
  }
  int MAX(int a, int b) {
    if (a > b)
      return a;
    else
      return b;
  }
  void _readIn(string fileName) {}
  void _output() {}
  void _process() {
    this->_readIn("input.txt");
    (cin) >> n >> k >> b >> a >> q;
    arr = *new vector<int>(2 << 21, 0);
    BIT* under_tree = new BIT(n);
    BIT* over_tree = new BIT(n);
    for (int i = 0; i < q; i++) {
      int type, di, ai, adder;
      (cin) >> type;
      if (type == 1) {
        (cin) >> di >> ai;
        arr[di] += ai;
        adder = arr[di] > a ? a - arr[di] + ai : ai;
        if (adder > 0) {
          under_tree->_increase(adder, di);
        }
        adder = arr[di] > b ? b - MAX(a, arr[di] - ai)
                            : arr[di] - MAX(a, arr[di] - ai);
        if (adder > 0) {
          over_tree->_increase(adder, di);
        }
      } else {
        (cin) >> di;
        long long a1 = under_tree->_query(n);
        long long a2 = under_tree->_query(di + k - 1);
        long long acc = under_tree->_query(di - 1) + a1 - a2;
        acc += over_tree->_query(n) - over_tree->_query(di + k - 1);
        cout << acc << endl;
      }
    }
  }
};
int main() {
  Solution* sl = new Solution();
  sl->_process();
}
