#include <bits/stdc++.h>
using namespace std;
long long tree1[200010], tree2[200010];
void update(int idx, long long val, long long tree[]) {
  while (idx < 200010) {
    tree[idx] += val;
    idx += (idx & -idx);
  }
}
long long read(int idx, long long tree[]) {
  long long sum = 0;
  while (idx > 0) {
    sum += tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void solve() {
  int n, k, a, b, q, t, d, ord;
  long long tmp1;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    cin >> t;
    if (t == 1) {
      cin >> d >> ord;
      tmp1 = min(read(d, tree1) - read(d - 1, tree1) + ord, (long long)b) -
             (read(d, tree1) - read(d - 1, tree1));
      update(d, tmp1, tree1);
      tmp1 = min(read(d, tree2) - read(d - 1, tree2) + ord, (long long)a) -
             (read(d, tree2) - read(d - 1, tree2));
      update(d, tmp1, tree2);
    } else {
      cin >> d;
      cout << read(d - 1, tree1) + read(200010 - 1, tree2) -
                  read(min(200010 - 1, d + k - 1), tree2)
           << endl;
    }
  }
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
