#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q, i, j, t, x, y;
long long bit[200005], bit1[200005];
void update(int s, int r) {
  for (int k = s; k <= n; k += (k & -k)) bit[k] += r;
}
long long query(int s) {
  long long val = 0;
  for (int k = s; k > 0; k -= (k & -k)) val += bit[k];
  return val;
}
void update1(int s, int r) {
  for (int k = s; k <= n; k += (k & -k)) bit1[k] += r;
}
long long query1(int s) {
  long long val = 0;
  for (int k = s; k > 0; k -= (k & -k)) val += bit1[k];
  return val;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  for (i = 0; i < q; i++) {
    scanf("%d%d", &t, &x);
    if (t == 1) {
      scanf("%d", &y);
      long long val = query(x) - query(x - 1);
      long long add = min((long long)y, b - val);
      update(x, add);
      val = query1(x) - query1(x - 1);
      add = min((long long)y, a - val);
      update1(x, add);
    } else {
      long long val = query(x - 1);
      long long val1 = query1(n) - query1(x + k - 1);
      printf("%lld\n", val + val1);
    }
  }
}
