#include <bits/stdc++.h>
using namespace std;
int maxn = 200000;
long long a[3][200005];
long long order[200005];
long long min(long long a, long long b) { return a <= b ? a : b; }
int lowbit(int x) { return x & -x; }
long long getsum(int t, int x) {
  long long sum = 0;
  for (int i = x; i > 0; i -= lowbit(i)) sum += a[t][i];
  return sum;
}
void add(int t, int x, int b) {
  for (int i = x; i <= maxn; i += lowbit(i)) a[t][i] += b;
}
int main() {
  int q, a, b, c, n, k;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  memset(order, 0, sizeof(order));
  while (q--) {
    int ch;
    scanf("%d", &ch);
    if (ch == 1) {
      int d, x;
      scanf("%d%d", &d, &x);
      long long pre = order[d];
      order[d] += x;
      add(2, d, min(a, order[d]) - min(a, pre));
      add(1, d, min(b, order[d]) - min(b, pre));
    } else {
      int p;
      scanf("%d", &p);
      long long ans = getsum(1, p - 1) + getsum(2, n) - getsum(2, p + k - 1);
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
