#include <bits/stdc++.h>
using namespace std;
struct Tree {
  int val, val1;
};
Tree a[600000];
long long N = 1, p, q, V, Ans = 0, A, B, Q, T, l;
void Update(int k, int x, int y) {
  if (x > q || y < p) return;
  if (x == y && x == p) {
    a[k].val += V;
    a[k].val1 += V;
    if (a[k].val > A) a[k].val = A;
    if (a[k].val1 > B) a[k].val1 = B;
    return;
  }
  Update(k * 2, x, (x + y) / 2);
  Update(k * 2 + 1, (x + y) / 2 + 1, y);
  a[k].val = a[k * 2].val + a[k * 2 + 1].val;
  a[k].val1 = a[k * 2].val1 + a[k * 2 + 1].val1;
}
void Query(int k, int x, int y) {
  if (x > q || y < p) return;
  if (x >= p && y <= q) {
    if (!l)
      Ans += a[k].val;
    else
      Ans += a[k].val1;
    return;
  }
  Query(k * 2, x, (x + y) / 2);
  Query(k * 2 + 1, (x + y) / 2 + 1, y);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k, ANS, t;
  cin >> n >> k >> A >> B >> Q;
  while (N < n) N *= 2;
  for (int i = 1; i <= Q; i++) {
    cin >> t;
    if (t == 1) {
      cin >> T >> V;
      p = T;
      q = T;
      Update(1, 1, N);
    }
    if (t == 2) {
      ANS = 0;
      cin >> T;
      p = 1;
      q = T - 1;
      Ans = 0;
      l = 1;
      if (p <= q) Query(1, 1, N);
      ANS += Ans;
      p = T + k;
      q = N;
      Ans = 0;
      l = 0;
      Query(1, 1, N);
      ANS += Ans;
      cout << ANS << "\n";
      ANS = 0;
    }
  }
  return 0;
}
