#include <bits/stdc++.h>
using namespace std;
int tree[3000005];
int tree2[3000005];
int n, k, a, b, q;
int lowbit(int x) { return x & (-x); }
int sum2(int x) {
  int sum = 0;
  while (x > 0) {
    sum += tree2[x];
    x -= lowbit(x);
  }
  return sum;
}
void add2(int x, int c) {
  while (x <= n) {
    tree2[x] += c;
    x += lowbit(x);
  }
}
int sum(int x) {
  int sum = 0;
  while (x > 0) {
    sum += tree[x];
    x -= lowbit(x);
  }
  return sum;
}
void add(int x, int c) {
  while (x <= n) {
    tree[x] += c;
    x += lowbit(x);
  }
}
int main() {
  while (~scanf("%d%d%d%d%d", &n, &k, &a, &b, &q)) {
    memset(tree, 0, sizeof(tree));
    memset(tree2, 0, sizeof(tree2));
    while (q--) {
      int op;
      scanf("%d", &op);
      if (op == 1) {
        int pos, val, ad;
        scanf("%d%d", &pos, &val);
        int posval = sum(pos) - sum(pos - 1);
        if (posval + val > b)
          ad = b - posval;
        else
          ad = val;
        add(pos, ad);
        posval = sum2(pos) - sum2(pos - 1);
        if (posval + val > a)
          ad = a - posval;
        else
          ad = val;
        add2(pos, ad);
      } else {
        int pos;
        scanf("%d", &pos);
        int output = 0;
        output += sum(pos - 1);
        pos += k - 1;
        output += sum2(n) - sum2(pos);
        printf("%d\n", output);
      }
    }
  }
}
