#include <bits/stdc++.h>
using namespace std;
vector<long long> a1, b2;
vector<long long> t1, t2;
void inc1(int i, int d) {
  for (; i < t1.size(); i = (i | (i + 1))) t1[i] += d;
}
void inc2(int i, int d) {
  for (; i < t2.size(); i = (i | (i + 1))) t2[i] += d;
}
long long sum1(int r) {
  long long res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) res += t1[r];
  return res;
}
long long sum2(int r) {
  long long res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) res += t2[r];
  return res;
}
int main() {
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  a1.resize(n);
  b2.resize(n);
  t1.resize(n);
  t2.resize(n);
  for (int i = 0; i < q; i++) {
    long long x, y, z;
    cin >> x;
    if (x == 1) {
      cin >> y >> z;
      y--;
      int p = 0;
      if (a1[y] < a) {
        inc1(y, min(a - a1[y], z));
        a1[y] += z;
      }
      if (b2[y] < b) {
        inc2(y, min(b - b2[y], z));
        b2[y] += z;
      }
    } else {
      cin >> y;
      y--;
      long long ans = 0;
      if (y - 1 >= 0) ans += sum2(y - 1);
      long long ans1 = 0;
      ans1 = sum1(n - 1) - sum1(y - 1 + k);
      cout << ans + ans1 << '\n';
    }
  }
  return 0;
}
