#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int sum[maxn << 2], sum1[maxn << 2], sum2[maxn << 2];
int a, b;
void push_up(int rt) {
  sum[rt] = sum[rt << 1] + sum[rt << 1 | 1];
  sum1[rt] = sum1[rt << 1] + sum1[rt << 1 | 1];
  sum2[rt] = sum2[rt << 1] + sum2[rt << 1 | 1];
}
void update(int l, int r, int rt, int pos, int val) {
  if (l == r) {
    sum[rt] += val;
    if (sum[rt] >= a) {
      sum1[rt] = a;
      sum2[rt] = b;
    } else if (sum[rt] < a && sum[rt] > b) {
      sum1[rt] = sum[rt];
      sum2[rt] = b;
    } else
      sum1[rt] = sum2[rt] = sum[rt];
    return;
  }
  int m = (l + r) >> 1;
  if (pos <= m)
    update(l, m, rt << 1, pos, val);
  else
    update(m + 1, r, rt << 1 | 1, pos, val);
  push_up(rt);
}
int query(int l, int r, int rt, int L, int R, int op) {
  if (L <= l && r <= R) {
    if (op == 2) return sum1[rt];
    return sum2[rt];
  }
  int m = (l + r) >> 1;
  int ans = 0;
  if (L <= m) ans += query(l, m, rt << 1, L, R, op);
  if (R > m) ans += query(m + 1, r, rt << 1 | 1, L, R, op);
  return ans;
}
int main() {
  int n, k, q;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int op;
    cin >> op;
    if (op == 1) {
      int pos, val;
      cin >> pos >> val;
      update(1, n, 1, pos, val);
    } else {
      int x, ans1 = 0, ans2 = 0;
      cin >> x;
      if (x != 1) ans1 = query(1, n, 1, 1, x - 1, 1);
      ans2 = query(1, n, 1, x + k, n, 2);
      cout << ans1 + ans2 << "\n";
    }
  }
  return 0;
}
