#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q, x, c, y;
int t[4 * 222222], g[4 * 222222];
void update(int v, int l, int r, int pos, int val) {
  if (l == r) {
    g[v] += val;
    g[v] = (g[v] > b ? b : g[v]);
    t[v] += val;
    t[v] = (t[v] > a ? a : t[v]);
    return;
  }
  int m = (l + r) / 2;
  if (pos <= m)
    update(v * 2, l, m, pos, val);
  else
    update(v * 2 + 1, m + 1, r, pos, val);
  g[v] = g[v * 2] + g[v * 2 + 1];
  t[v] = t[v * 2] + t[v * 2 + 1];
}
int find(int v, int l, int r, int A, int B) {
  if (l > B || r < A) return 0;
  if (A <= l && r <= B) return g[v];
  int m = (l + r) / 2;
  return find(v * 2, l, m, A, B) + find(v * 2 + 1, m + 1, r, A, B);
}
int find2(int v, int l, int r, int A, int B) {
  if (l > B || r < A) return 0;
  if (A <= l && r <= B) return t[v];
  int m = (l + r) / 2;
  return find2(v * 2, l, m, A, B) + find2(v * 2 + 1, m + 1, r, A, B);
}
int main() {
  cin >> n >> k >> a >> b >> q;
  for (int i = 1; i <= q; i++) {
    cin >> c >> x;
    if (c == 1) {
      cin >> y;
      update(1, 1, n, x, y);
    } else
      cout << find(1, 1, n, 1, x - 1) + find2(1, 1, n, x + k, n) << endl;
  }
  return 0;
}
