#include <bits/stdc++.h>
using namespace std;
long long fpow(long long base, long long power) {
  long long result = 1;
  while (power > 0) {
    if (power % 2 == 1) {
      result = (result * base);
    }
    base = (base * base);
    power /= 2;
  }
  return result;
}
long long dp[300000];
long long rdp[300000];
long long a, b;
inline void make_fenwick(long long idx, long long val, long long N) {
  val = min(val, b);
  while (idx <= N) {
    dp[idx] += val;
    idx += idx & (-idx);
  }
}
long long query_fenwick(long long idx) {
  long long res = 0;
  while (idx > 0) {
    res += dp[idx];
    idx -= idx & (-idx);
  }
  return res;
}
inline void rmake_fenwick(long long idx, long long val, long long N) {
  val = min(val, a);
  while (idx <= N) {
    rdp[idx] += val;
    idx += idx & (-idx);
  }
}
long long rquery_fenwick(long long idx) {
  long long res = 0;
  while (idx > 0) {
    res += rdp[idx];
    idx -= idx & (-idx);
  }
  return res;
}
long long orderlist[300000];
int main() {
  memset(dp, 0, sizeof(dp));
  memset(rdp, 0, sizeof(rdp));
  long long n, k, q;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    long long key;
    cin >> key;
    if (key == 1) {
      long long day, orders;
      cin >> day >> orders;
      long long jj = max((long long)0, min(b - orderlist[day], orders));
      long long zz = max((long long)0, min(a - orderlist[day], orders));
      orderlist[day] += orders;
      make_fenwick(day, jj, n + 3);
      rmake_fenwick(n - day + 1, zz, n + 3);
    } else {
      long long qday;
      cin >> qday;
      long long ans = query_fenwick(qday - 1);
      ans += rquery_fenwick(n - (qday + k) + 1);
      cout << ans << endl;
    }
  }
  return 0;
}
