#include <bits/stdc++.h>
using namespace std;
class fenwick_tree {
  vector<long long> t;
  long long size;

 public:
  fenwick_tree(long long n) {
    t.assign(n + 1, 0);
    size = n + 1;
  }
  long long LSOne(long long k) { return k & (-k); }
  void update(long long index, long long val) {
    for (; index < size; index += LSOne(index)) t[index] += val;
  }
  long long query_full(long long a, long long b) {
    if (a > b) return 0;
    return query(b) - ((a <= 1) ? 0 : query(a - 1));
  }
  long long query(long long b) {
    if (b < 1) return 0;
    long long sum = 0;
    for (; b; b -= LSOne(b)) sum += t[b];
    return sum;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k, a, b, q, i, j, id, d, x, p, ans, x1, x2;
  cin >> n >> k >> a >> b >> q;
  vector<long long> s(n + 1, 0), sa(n + 1, 0), sb(n + 1, 0);
  fenwick_tree fta(n + 10), ftb(n + 10);
  while (q--) {
    cin >> id;
    if (id == 1) {
      cin >> d >> x;
      s[d] += x;
      fta.update(d, -sa[d]);
      ftb.update(d, -sb[d]);
      sa[d] = min(a, s[d]);
      sb[d] = min(b, s[d]);
      fta.update(d, sa[d]);
      ftb.update(d, sb[d]);
    } else {
      cin >> p;
      x1 = ftb.query_full(1, p - 1);
      x2 = fta.query_full(p + k, n);
      ans = x1 + x2;
      cout << ans << "\n";
    }
  }
  return 0;
}
