#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200100;
int N, K, A, B, Q;
int fenA[MaxN], fenB[MaxN];
int arr[MaxN];
int x[MaxN];
int qA(int ind) {
  int ret = 0;
  for (; ind >= 0; ind = (ind & (ind + 1)) - 1) ret += fenA[ind];
  return ret;
}
void upA(int ind, int val) {
  for (; ind <= N; ind |= ind + 1) fenA[ind] += val;
}
int qB(int ind) {
  int ret = 0;
  for (; ind >= 0; ind = (ind & (ind + 1)) - 1) ret += fenB[ind];
  return ret;
}
void upB(int ind, int val) {
  for (; ind <= N; ind |= ind + 1) fenB[ind] += val;
}
void query(int ind) {
  ind--;
  int ret = 0;
  ret += qB(ind - 1);
  if (ind + K - 1 < N - 1) {
    ret += qA(N - 1) - qA(ind + K - 1);
  }
  printf("%d\n", ret);
}
void upd(int ind, int val) {
  ind--;
  if (x[ind] + val > A) {
    if (x[ind] < A) upA(ind, A - x[ind]);
  } else
    upA(ind, val);
  if (x[ind] + val > B) {
    if (x[ind] < B) upB(ind, B - x[ind]);
  } else
    upB(ind, val);
  x[ind] += val;
}
void solve() {
  int q_type, q_ind, q_val;
  for (int i = 0; i < Q; i++) {
    scanf("%d%d", &q_type, &q_ind);
    if (q_type == 1) {
      scanf("%d", &q_val);
      upd(q_ind, q_val);
    } else
      query(q_ind);
  }
}
void load() { scanf("%d%d%d%d%d", &N, &K, &A, &B, &Q); }
int main() {
  load();
  solve();
  return 0;
}
