#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const int mx = 2e5 + 9;
int n, k, a, b, q;
ll a_tree[4 * mx];
ll b_tree[4 * mx];
void update(int node, int l, int r, int d_i, ll a_i) {
  int mid = (l + r) / 2;
  int left = 2 * node;
  int right = left + 1;
  if (d_i < l or d_i > r) return;
  if (l == d_i and r == d_i) {
    a_tree[node] = min((ll)a, a_tree[node] + a_i);
    b_tree[node] = min((ll)b, b_tree[node] + a_i);
    return;
  }
  update(left, l, mid, d_i, a_i);
  update(right, mid + 1, r, d_i, a_i);
  a_tree[node] = a_tree[left] + a_tree[right];
  b_tree[node] = b_tree[left] + b_tree[right];
  return;
}
pll query(int node, int l, int r, int L, int R) {
  int mid = (l + r) / 2;
  int left = 2 * node;
  int right = left + 1;
  if (L > r or R < l) return {0LL, 0LL};
  if (L <= l and r <= R) {
    return {a_tree[node], b_tree[node]};
  }
  pll lq = query(left, l, mid, L, R);
  pll rq = query(right, mid + 1, r, L, R);
  return {lq.first + rq.first, lq.second + rq.second};
}
void traverse(int node, int l, int r) {
  int mid = (l + r) / 2;
  int left = 2 * node;
  int right = left + 1;
  if (l == r) {
    printf("(%lld, %lld) ", a_tree[node], b_tree[node]);
    return;
  }
  traverse(left, l, mid);
  traverse(right, mid + 1, r);
}
int main() {
  scanf("%d %d %d %d %d", &n, &k, &a, &b, &q);
  while (q--) {
    int c;
    scanf("%d", &c);
    if (c == 1) {
      int d_i, a_i;
      scanf("%d %d", &d_i, &a_i);
      update(1, 1, n, d_i, a_i);
    } else {
      int p_i;
      scanf("%d", &p_i);
      ll ans = 0;
      if (p_i - 1 > 0) ans += query(1, 1, n, 1, p_i - 1).second;
      if (p_i + k <= n) ans += query(1, 1, n, p_i + k, n).first;
      printf("%lld\n", ans);
    }
  }
}
