#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int i, j, n, m, k, t[4 * N], tt[4 * N], a[N], e[4 * N], ee[4 * N], B, A;
void update(int i, int l, int r, int a, int b, int k) {
  if (l != r - 1) {
    t[i * 2 + 1] += t[i], t[i * 2 + 2] += t[i];
    e[i * 2 + 1] += e[i], e[i * 2 + 2] += e[i];
  }
  tt[i] += t[i];
  ee[i] += e[i];
  t[i] = 0;
  e[i] = 0;
  if (a >= r || b <= l) return;
  if (a <= l && r <= b) {
    tt[i] = min(A, tt[i] + k);
    ee[i] = min(B, ee[i] + k);
    if (l != r - 1) {
      t[i * 2 + 1] = min(A, t[i * 2 + 1] + k),
                t[i * 2 + 2] = min(A, t[i * 2 + 2] + k);
      e[i * 2 + 1] = min(B, e[i * 2 + 1] + k),
                e[i * 2 + 2] = min(B, e[i * 2 + 2] + k);
    }
    return;
  }
  int m = (l + r) / 2;
  update(i * 2 + 1, l, m, a, b, k);
  update(i * 2 + 2, m, r, a, b, k);
  tt[i] = tt[i * 2 + 1] + tt[i * 2 + 2];
  ee[i] = ee[i * 2 + 1] + ee[i * 2 + 2];
}
int get(int i, int l, int r, int a, int b) {
  if (l != r - 1) t[i * 2 + 1] += t[i], t[i * 2 + 2] += t[i];
  tt[i] += t[i];
  t[i] = 0;
  if (a >= r || b <= l) return 0;
  if (a <= l && r <= b) return tt[i];
  int m = (l + r) / 2;
  m = get(i * 2 + 1, l, m, a, b) + get(i * 2 + 2, m, r, a, b);
  tt[i] = tt[i * 2 + 1] + tt[i * 2 + 2];
  return m;
}
int get1(int i, int l, int r, int a, int b) {
  if (l != r - 1) e[i * 2 + 1] += e[i], e[i * 2 + 2] += e[i];
  ee[i] += e[i];
  e[i] = 0;
  if (a >= r || b <= l) return 0;
  if (a <= l && r <= b) return ee[i];
  int m = (l + r) / 2;
  m = get1(i * 2 + 1, l, m, a, b) + get1(i * 2 + 2, m, r, a, b);
  ee[i] = ee[i * 2 + 1] + ee[i * 2 + 2];
  return m;
}
int main() {
  ios_base::sync_with_stdio(0);
  int a, b, q;
  cin >> n >> k >> B >> A >> q;
  for (i = 0; i < q; i++) {
    int p, d, f;
    cin >> p >> d;
    if (p == 1) {
      cin >> f;
      update(0, 0, n, d - 1, d, f);
    } else {
      cout << get(0, 0, n, 0, d - 1) + get1(0, 0, n, d + k - 1, n) << endl;
    }
  }
  return 0;
}
