#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
struct SegTree {
  int l, r, sum[2];
  int mid() { return (l + r) >> 1; }
} tree[maxn << 2];
int a, b;
void push_up(int rt) {
  tree[rt].sum[0] = tree[rt << 1].sum[0] + tree[rt << 1 | 1].sum[0];
  tree[rt].sum[1] = tree[rt << 1].sum[1] + tree[rt << 1 | 1].sum[1];
}
void build(int l, int r, int rt) {
  tree[rt].l = l;
  tree[rt].r = r;
  tree[rt].sum[0] = 0;
  tree[rt].sum[1] = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
}
void update(int pos, int rt, int add) {
  if (pos == tree[rt].l && tree[rt].r == pos) {
    tree[rt].sum[0] += add;
    tree[rt].sum[1] += add;
    if (tree[rt].sum[0] > b) tree[rt].sum[0] = b;
    if (tree[rt].sum[1] > a) tree[rt].sum[1] = a;
    return;
  }
  int mid = tree[rt].mid();
  if (pos <= mid)
    update(pos, rt << 1, add);
  else
    update(pos, rt << 1 | 1, add);
  push_up(rt);
}
int query(int l, int r, int rt, int id) {
  if (l <= tree[rt].l && tree[rt].r <= r) {
    return tree[rt].sum[id];
  }
  int mid = tree[rt].mid();
  int sum = 0;
  if (l <= mid) sum += query(l, r, rt << 1, id);
  if (mid < r) sum += query(l, r, rt << 1 | 1, id);
  return sum;
}
int main() {
  int n, k, q, ope, d, ai, p;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  build(1, n, 1);
  while (q--) {
    scanf("%d", &ope);
    if (ope == 1) {
      scanf("%d%d", &d, &ai);
      update(d, 1, ai);
    } else {
      scanf("%d", &p);
      int ans = 0;
      if (p > 1) ans += query(1, p - 1, 1, 0);
      if (p + k - 1 < n) ans += query(p + k, n, 1, 1);
      printf("%d\n", ans);
    }
  }
  return 0;
}
