#include <bits/stdc++.h>
using namespace std;
int n, k, aa, bb, q;
int tree1[1000009], tree2[1000009];
void update_tree(int node, int a, int b, int x, int val) {
  if (a > b || a > x || x > b) return;
  if (a == b) {
    tree1[node] = min(aa, tree1[node] + val);
    tree2[node] = min(bb, tree2[node] + val);
    return;
  }
  int mid = (a + b) / 2;
  update_tree(node * 2, a, mid, x, val);
  update_tree(node * 2 + 1, mid + 1, b, x, val);
  tree1[node] = tree1[node * 2] + tree1[node * 2 + 1];
  tree2[node] = tree2[node * 2] + tree2[node * 2 + 1];
}
int query_tree(int node, int a, int b, int i, int j, int type) {
  if (a > b || a > j || b < i) return 0;
  if (i <= a && b <= j) {
    if (type == 1)
      return tree1[node];
    else
      return tree2[node];
  }
  int mid = (a + b) / 2;
  int s1 = query_tree(2 * node, a, mid, i, j, type);
  int s2 = query_tree(2 * node + 1, mid + 1, b, i, j, type);
  return s1 + s2;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, &aa, &bb, &q);
  while (q--) {
    int type, inp1, inp2;
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%d", &inp1, &inp2);
      update_tree(1, 0, n - 1, inp1 - 1, inp2);
    } else {
      scanf("%d", &inp1);
      inp1--;
      int r1 = query_tree(1, 0, n - 1, 0, inp1 - 1, 2);
      int r2 = query_tree(1, 0, n - 1, inp1 + k, n - 1, 1);
      printf("%d\n", (r1 + r2));
    }
  }
  return 0;
}
