#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e8;
class fenwick {
 public:
  int n, mod;
  vector<int> t;
  int nextF(int x) { return (x & (x + 1)); }
  int nextH(int x) { return (x | (x + 1)); }
  int sum(int l) {
    int res = 0;
    for (int i = l; i >= 0; i = nextF(i) - 1) res += t[i];
    return res;
  }
  int sum(int l, int r) { return sum(r) - sum(l - 1); }
  void inc(int x, int a) {
    for (int i = x; i < n; i = nextH(i)) {
      t[i] += a;
    }
  }
  fenwick(int n, int mod) : n(n), mod(mod), t() { t.resize(n, 0); }
};
int main() {
  ios_base::sync_with_stdio(0);
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  fenwick f1 = fenwick(n, b);
  fenwick f2 = fenwick(n, a);
  for (int i = 0; i < q; i++) {
    int type;
    cin >> type;
    if (type == 1) {
      int d, x;
      cin >> d >> x;
      d--;
      int s = f1.sum(d, d);
      f1.inc(d, min(x, b - s));
      s = f2.sum(d, d);
      f2.inc(d, min(x, a - s));
    } else {
      int p;
      cin >> p;
      p--;
      cout << f1.sum(0, p - 1) + f2.sum(p + k, n - 1) << '\n';
    }
  }
  return 0;
}
