#include <bits/stdc++.h>
using namespace std;
const int maxN = 200009;
vector<int> d(4 * maxN, 0);
vector<int> t(4 * maxN, 0);
vector<int> e(4 * maxN, 0);
vector<int> u(4 * maxN, 0);
int n, k, a, b, q;
void update(int i, int l, int r, int p, int g) {
  if (l + 1 == r) {
    if (!e[i] && g + u[i] >= b) {
      u[i] = 0;
      e[i] = 1;
    } else if (!e[i] && g + u[i] < b) {
      u[i] += g;
    }
    if (!t[i] && g + d[i] >= a) {
      d[i] = 0;
      t[i] = 1;
    } else if (!t[i] && g + d[i] < a) {
      d[i] += g;
    }
  } else {
    int m = (l + r) / 2;
    if (p < m)
      update(2 * i + 1, l, m, p, g);
    else
      update(2 * i + 2, m, r, p, g);
    u[i] = u[2 * i + 1] + u[2 * i + 2];
    d[i] = d[2 * i + 1] + d[2 * i + 2];
    e[i] = e[2 * i + 1] + e[2 * i + 2];
    t[i] = t[2 * i + 1] + t[2 * i + 2];
  }
}
int gett(int i, int l, int r, int q, int w, int v) {
  if (l >= w || r <= q) return 0;
  if (l >= q && r <= w) {
    return v * (t[i] * a + d[i]) + (1 - v) * (e[i] * b + u[i]);
  }
  int m = (l + r) / 2;
  int z = gett(2 * i + 1, l, m, q, w, v);
  int x = gett(2 * i + 2, m, r, q, w, v);
  return z + x;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  for (int i = 0; i < q; i++) {
    int c;
    scanf("%d", &c);
    if (c == 1) {
      int p, g;
      scanf("%d%d", &p, &g);
      p--;
      update(0, 0, n, p, g);
    } else {
      int p;
      scanf("%d", &p);
      p--;
      printf("%d\n", gett(0, 0, n, 0, p, 0) + gett(0, 0, n, p + k, n, 1));
    }
  }
  return 0;
}
