#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
using namespace std;
const long long N = 200010;
long long n, k, a, b, q;
long long v[N] = {};
struct ft {
  long long t[N];
  void update(long long idx, long long val) {
    for (; idx <= n; idx += idx & -idx) {
      t[idx] += val;
    }
  }
  long long get(long long idx) {
    long long ret = 0;
    for (; idx >= 1; idx -= idx & -idx) {
      ret += t[idx];
    }
    return ret;
  }
} pre, suf;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> a >> b >> q;
  for (long long i = 1; i <= q; i++) {
    long long t;
    cin >> t;
    if (t == 1) {
      long long day, val;
      cin >> day >> val;
      pre.update(day, max(0LL, min(val, b - v[day])));
      suf.update(n - day + 1, max(0LL, min(val, a - v[day])));
      v[day] += val;
    } else {
      long long p;
      cin >> p;
      cout << pre.get(p - 1) + suf.get(n - (p + k) + 1) << '\n';
    }
  }
  return 0;
}
