#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000009;
const long long MAX = 1000000000000000009;
int n, k, a, b, q, before[maxN], after[maxN], d, ile, pocz, x;
int read(int x, int t[]) {
  int res = 0;
  for (; x > 0; x -= (x & -x)) res += t[x];
  return res;
}
void update(int x, int w, int t[]) {
  for (; x <= n; x += (x & -x)) {
    t[x] += w;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k >> a >> b >> q;
  for (int i = 0; i < q; i++) {
    cin >> x;
    if (x == 1) {
      cin >> d >> ile;
      int bef = read(d, before) - read(d - 1, before);
      int aft = read(d, after) - read(d - 1, after);
      bef = min(bef + ile, b) - bef;
      aft = min(aft + ile, a) - aft;
      update(d, bef, before);
      update(d, aft, after);
    } else {
      cin >> pocz;
      cout << read(pocz - 1, before) + read(n, after) -
                  read(pocz + k - 1, after)
           << endl;
    }
  }
  return 0;
}
