#include <bits/stdc++.h>
const double EPS = 0.00000001;
const long long mod = 1000000000 + 7;
using namespace std;
const int MAXN = 200010;
long long t[4 * MAXN], tt[4 * MAXN];
long long n, k, b, a, q;
long long sum(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (l == tl && r == tr)
    return t[v];
  else {
    int tm = (tl + tr) / 2;
    return sum(v * 2, tl, tm, l, min(r, tm)) +
           sum(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
  }
}
void update(int v, int tl, int tr, int pos, int new_val) {
  if (tl == tr)
    t[v] = new_val;
  else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update(v * 2, tl, tm, pos, new_val);
    else
      update(v * 2 + 1, tm + 1, tr, pos, new_val);
    t[v] = t[2 * v] + t[v * 2 + 1];
  }
}
long long tsum(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  int x = tt[v];
  if (l == tl && r == tr)
    return tt[v];
  else {
    int tm = (tl + tr) / 2;
    return tsum(v * 2, tl, tm, l, min(r, tm)) +
           tsum(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
  }
}
void tupdate(int v, int tl, int tr, int pos, int new_val) {
  if (tl == tr)
    tt[v] = new_val;
  else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      tupdate(v * 2, tl, tm, pos, new_val);
    else
      tupdate(v * 2 + 1, tm + 1, tr, pos, new_val);
    tt[v] = tt[2 * v] + tt[v * 2 + 1];
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k >> b >> a >> q;
  int x, y, z;
  while (q--) {
    cin >> x >> y;
    y--;
    if (x == 1) {
      cin >> z;
      long long aa = sum(1, 0, n - 1, y, y), bb = tsum(1, 0, n - 1, y, y);
      update(1, 0, n - 1, y, min(z + aa, a));
      tupdate(1, 0, n - 1, y, min(z + bb, b));
    } else {
      long long ans =
          sum(1, 0, n - 1, 0, y - 1) + tsum(1, 0, n - 1, y + k, n - 1);
      cout << ans << '\n';
    }
  }
  int ____________;
  cin >> ____________;
  return 0;
}
