#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200000 + 5;
struct Node {
  long long sumA, sumB;
  long long howMany;
};
Node tree[4 * MAX_N];
int N, K, A, B, Q;
void update(int node, int l, int r, int pos, long long key) {
  if (l == r) {
    tree[node].howMany += key;
    tree[node].sumA = min(1LL * A, tree[node].howMany);
    tree[node].sumB = min(1LL * B, tree[node].howMany);
  } else {
    int m = (l + r) / 2;
    if (pos <= m)
      update(2 * node, l, m, pos, key);
    else
      update(2 * node + 1, m + 1, r, pos, key);
    tree[node].sumA = tree[2 * node].sumA + tree[2 * node + 1].sumA;
    tree[node].sumB = tree[2 * node].sumB + tree[2 * node + 1].sumB;
  }
}
long long queryA(int node, int l, int r, int st, int dr) {
  if (st > dr) return 0;
  if (st <= l && r <= dr)
    return tree[node].sumA;
  else {
    int m = (l + r) / 2;
    long long sol = 0;
    if (st <= m) sol += queryA(2 * node, l, m, st, dr);
    if (m < dr) sol += queryA(2 * node + 1, m + 1, r, st, dr);
    return sol;
  }
}
long long queryB(int node, int l, int r, int st, int dr) {
  if (st > dr) return 0;
  if (st <= l && r <= dr)
    return tree[node].sumB;
  else {
    int m = (l + r) / 2;
    long long sol = 0;
    if (st <= m) sol += queryB(2 * node, l, m, st, dr);
    if (m < dr) sol += queryB(2 * node + 1, m + 1, r, st, dr);
    return sol;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N >> K >> A >> B >> Q;
  for (int i = 1; i <= Q; ++i) {
    int tip, d, a, p;
    cin >> tip;
    if (tip == 1) {
      cin >> d >> a;
      update(1, 1, N, d, a);
    } else {
      cin >> p;
      int l = p;
      int r = p + K - 1;
      long long answer = queryB(1, 1, N, 1, l - 1) + queryA(1, 1, N, r + 1, N);
      cout << answer << "\n";
    }
  }
  return 0;
}
