#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q;
int tree0[200100], tree1[200100], cnt[200100];
void add0(int x, int y) {
  for (int i = x; i <= n; i += ((i) & -(i))) tree0[i] += y;
}
void add1(int x, int y) {
  for (int i = x; i; i -= ((i) & -(i))) tree1[i] += y;
}
int ask0(int x) {
  int ans = 0;
  for (int i = x; i; i -= ((i) & -(i))) ans += tree0[i];
  return ans;
}
int ask1(int x) {
  int ans = 0;
  for (int i = x; i <= n; i += ((i) & -(i))) ans += tree1[i];
  return ans;
}
int main() {
  int i, j, ord, x, y;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  while (q--) {
    scanf("%d", &ord);
    if (ord == 1) {
      scanf("%d%d", &x, &y);
      if (cnt[x] < b) add0(x, min(b, cnt[x] + y) - cnt[x]);
      if (cnt[x] < a) add1(x, min(a, cnt[x] + y) - cnt[x]);
      cnt[x] += y;
    } else {
      scanf("%d", &x);
      printf("%d\n", ask0(x - 1) + ask1(x + k));
    }
  }
  return 0;
}
