#include <bits/stdc++.h>
using namespace std;
void update(int arr[], int ti, int tl, int tr, int i, int x, int mx) {
  if (tl == tr)
    arr[ti] = min(mx, arr[ti] + x);
  else {
    int mid = tl + (tr - tl) / 2;
    if (mid >= i)
      update(arr, ti * 2, tl, mid, i, x, mx);
    else
      update(arr, ti * 2 + 1, mid + 1, tr, i, x, mx);
    arr[ti] = arr[ti * 2] + arr[ti * 2 + 1];
  }
}
int query(int arr[], int ti, int tl, int tr, int l, int r) {
  if (l > r || tl > tr || tl > r || tr < l) return 0;
  if (tl >= l && tr <= r) return arr[ti];
  int mid = tl + (tr - tl) / 2;
  return query(arr, ti * 2, tl, mid, l, r) +
         query(arr, ti * 2 + 1, mid + 1, tr, l, r);
}
void solve() {
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  int atree[4 * n + 2], btree[4 * n + 2];
  memset(atree, 0, sizeof(atree));
  memset(btree, 0, sizeof(btree));
  while (q--) {
    int ty;
    cin >> ty;
    if (ty == 1) {
      int di, ai;
      cin >> di >> ai;
      update(atree, 1, 1, n, di, ai, a);
      update(btree, 1, 1, n, di, ai, b);
    } else {
      int x;
      cin >> x;
      cout << query(btree, 1, 1, n, 1, x - 1) + query(atree, 1, 1, n, x + k, n)
           << "\n";
    }
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
