#include <bits/stdc++.h>
using namespace std;
long long tree[2][200005 << 1LL];
long long A[200005], B[200005];
long long N, K, a, b, Q;
void update(int pos, int val, int f) {
  for (tree[f][pos += N] = val; pos >>= 1LL;)
    tree[f][pos] = tree[f][pos << 1LL] + tree[f][pos << 1LL | 1LL];
}
long long query(int l, int r, int f) {
  int ans = 0;
  for (l += N, r += N; l < r; l >>= 1LL, r >>= 1LL) {
    if (l & 1) ans = ans + tree[f][l++];
    if (r & 1) ans = ans + tree[f][--r];
  }
  return ans;
}
int main() {
  scanf("%lld %lld %lld %lld %lld", &N, &K, &a, &b, &Q);
  long long t, x, y;
  for (int k = 0; k < 2; k++)
    for (int j = 0; j < (2 * N); j++) tree[k][j] = 0;
  while (Q--) {
    scanf("%lld", &t);
    if (t == 1) {
      scanf("%lld %lld", &x, &y);
      --x;
      A[x] = A[x] + y;
      A[x] = min(A[x], b);
      update(x, A[x], 0);
      B[x] = B[x] + y;
      B[x] = min(B[x], a);
      update(x, B[x], 1);
    } else {
      scanf("%lld", &y);
      --y;
      long long ans = query(0, y, 0);
      ans = ans + query(y + K, N, 1);
      printf("%lld\n", ans);
    }
  }
}
