#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)5e5 + 22;
int ta[4 * MAXN], tb[4 * MAXN];
int n, A, B;
void update(int v, int l, int r, int x, int d) {
  if (r - l == 1) {
    ta[v] += d;
    ta[v] = min(ta[v], A);
    tb[v] += d;
    tb[v] = min(tb[v], B);
    return;
  }
  int mid = (l + r) / 2;
  if (x < mid)
    update(2 * v + 1, l, mid, x, d);
  else
    update(2 * v + 2, mid, r, x, d);
  ta[v] = ta[2 * v + 1] + ta[2 * v + 2];
  tb[v] = tb[2 * v + 1] + tb[2 * v + 2];
}
int getA(int v, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) return ta[v];
  if (ql >= r || qr <= l) return 0;
  int mid = (l + r) / 2, sa, sb;
  sa = getA(2 * v + 1, l, mid, ql, qr);
  sb = getA(2 * v + 2, mid, r, ql, qr);
  return sa + sb;
}
int getB(int v, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) return tb[v];
  if (ql >= r || qr <= l) return 0;
  int mid = (l + r) / 2, sa, sb;
  sa = getB(2 * v + 1, l, mid, ql, qr);
  sb = getB(2 * v + 2, mid, r, ql, qr);
  return sa + sb;
}
int query(int l, int r) {
  int ans = 0;
  if (l != 0) ans += getB(0, 0, n, 0, l);
  if (r != n) ans += getA(0, 0, n, r, n);
  return ans;
}
int main() {
  int q, k;
  scanf("%d %d %d %d %d", &n, &k, &A, &B, &q);
  int type, d, x, p;
  for (int i = 0; i < q; i++) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d %d", &d, &x);
      --d;
      update(0, 0, n, d, x);
    } else {
      scanf("%d", &p);
      --p;
      printf("%d\n", query(p, p + k));
    }
  }
  return 0;
}
