#include <bits/stdc++.h>
using namespace std;
int t[2][1000000];
int cnt[1000000];
void upd(int p, int v, int l, int r, int idx, int val) {
  if (l == r) {
    t[p][v] = val;
    return;
  }
  int m = (l + r) / 2;
  if (idx <= m)
    upd(p, 2 * v, l, m, idx, val);
  else
    upd(p, 2 * v + 1, m + 1, r, idx, val);
  t[p][v] = t[p][2 * v] + t[p][2 * v + 1];
}
int sum(int p, int v, int l, int r, int ql, int qr) {
  if (l == ql && r == qr) return t[p][v];
  if (ql > qr) return 0;
  int m = (l + r) / 2;
  return sum(p, 2 * v, l, m, ql, min(qr, m)) +
         sum(p, 2 * v + 1, m + 1, r, max(m + 1, ql), qr);
}
int main() {
  int n, k, a, b, q, x, ans, p;
  cin >> n >> k >> a >> b >> q;
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 1000000; ++j) {
      t[i][j] = 0;
      cnt[j] = 0;
    }
  int type, d;
  for (int z = 0; z < q; ++z) {
    cin >> type;
    if (type == 1) {
      cin >> d >> x;
      cnt[d] += x;
      upd(0, 1, 1, n, d, min(cnt[d], b));
      upd(1, 1, 1, n, d, min(cnt[d], a));
    } else {
      cin >> p;
      ans = sum(0, 1, 1, n, 1, p - 1);
      if (p + k <= n) ans += sum(1, 1, 1, n, p + k, n);
      cout << ans << endl;
    }
  }
  return 0;
}
