#include <bits/stdc++.h>
using namespace std;
template <class C>
void mini(C &a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C &a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
long long n, k, a, b, q;
long long dp[2][200001];
void dod(long long kt, long long a, long long il) {
  (kt, a, il);
  a++;
  for (; a <= n; a += (a & -a)) dp[kt][a] += il;
}
long long sum(long long kt, long long a) {
  (kt, a);
  long long res = 0;
  for (; a; a -= (a & -a)) res += dp[kt][a];
  return res;
}
struct {
  long long lim;
  long long sum;
  long long dodaj(long long w) {
    sum += w;
    if (sum > lim) {
      w -= sum - lim;
      sum = lim;
    }
    return w;
  }
} wara[200001], warb[200001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cin >> n >> k >> a >> b >> q;
  for (long long i = 0; i < n; i++) {
    wara[i].lim = a;
    warb[i].lim = b;
  }
  for (long long i = 0; i < q; i++) {
    long long z;
    cin >> z;
    if (z == 1) {
      long long d, x;
      cin >> d >> x;
      d--;
      dod(0, d, wara[d].dodaj(x));
      dod(1, d, warb[d].dodaj(x));
    } else {
      long long d;
      cin >> d;
      d--;
      cout << sum(1, d) + sum(0, n) - sum(0, d + k) << "\n";
    }
  }
}
