#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int first;
  int second;
} node;
int n, m, l, r, sz = 1, d, st, ed, q, check, v, val, id, ans;
node t[4 * 200005];
inline void build(int n) {
  while (sz < n) sz *= 2;
}
node ret_val(node l, node r) {
  node res;
  res.first = l.first + r.first;
  res.second = l.second + r.second;
  return res;
}
inline void update(int v, int val, int a, int b) {
  if ((t[v].first + val) - a <= 0)
    t[v].first += val;
  else
    t[v].first = a;
  if ((t[v].second + val) - b <= 0)
    t[v].second += val;
  else
    t[v].second = b;
  v /= 2;
  while (v) {
    t[v] = ret_val(t[2 * v], t[2 * v + 1]);
    v /= 2;
  }
}
node make_data() {
  node res;
  res.first = 0;
  res.second = 0;
  return res;
}
node get(int v, int l, int r, int ql, int qr) {
  if (l > qr || r < ql) return make_data();
  if (l >= ql && r <= qr) return t[v];
  return ret_val(get(2 * v, l, (l + r) / 2, ql, qr),
                 get(2 * v + 1, (l + r) / 2 + 1, r, ql, qr));
}
int main() {
  scanf("%d %d %d %d %d", &n, &d, &st, &ed, &q);
  build(n);
  while (q--) {
    scanf("%d", &check);
    if (check == 1) {
      scanf("%d %d", &v, &val);
      update(sz + v - 1, val, st, ed);
    } else {
      ans = 0;
      scanf("%d", &id);
      ans += get(1, sz, 2 * sz - 1, sz, sz + id - 2).second;
      ans += get(1, sz, 2 * sz - 1, sz + id + d - 1, 2 * sz - 1).first;
      printf("%d\n", ans);
    }
  }
  return 0;
}
