#include <bits/stdc++.h>
using namespace std;
struct FenwickTree {
  vector<long long> tree;
  FenwickTree(long long n) : tree(n + 1) {}
  long long sum(long long pos) {
    ++pos;
    long long ret = 0;
    while (pos > 0) {
      ret += tree[pos];
      pos &= (pos - 1);
    }
    return ret;
  }
  void add(long long pos, long long val) {
    ++pos;
    while (pos < tree.size()) {
      tree[pos] += val;
      pos += (pos & -pos);
    }
  }
};
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  FenwickTree fa(n + 28), fb(n + 28);
  vector<long long> arr(n + 18), brr(n + 18);
  while (q--) {
    long long type;
    cin >> type;
    if (type == 1) {
      long long d, val;
      cin >> d >> val;
      long long first = min(val, a - arr[d]);
      long long second = min(val, b - brr[d]);
      arr[d] += first;
      brr[d] += second;
      fa.add(d, first);
      fb.add(d, second);
    } else {
      long long p;
      cin >> p;
      cout << fb.sum(p - 1) + fa.sum(n) - fa.sum(p + k - 1) << endl;
    }
  }
}
