#include <bits/stdc++.h>
using namespace std;
int LEN = 262144;
void add(vector<int> &tree, int idx, int val, int maxval) {
  idx += LEN - 1;
  int diff = min(val, maxval - tree[idx]);
  tree[idx] = min(tree[idx] + val, maxval);
  while (idx) {
    idx = (idx - 1) / 2;
    tree[idx] += diff;
  }
}
int getsum(const vector<int> &tree, int l, int r) {
  if (r < 0 || l > 200000) {
    return 0;
  }
  l += LEN - 1;
  r += LEN - 1;
  int ans = 0;
  while (l <= r) {
    if (l % 2 == 0) {
      ans += tree[l];
      l++;
    }
    if (r % 2 == 1) {
      ans += tree[r];
      r--;
    }
    if (l > r) {
      break;
    }
    l = (l - 1) / 2;
    r = (r - 1) / 2;
  }
  return ans;
}
int main() {
  int n, k, a, b, q;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  vector<int> atree(2 * LEN - 1, 0);
  vector<int> btree(2 * LEN - 1, 0);
  for (int i = 0; i < q; ++i) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int amt, d;
      scanf("%d%d", &d, &amt);
      add(atree, d - 1, amt, a);
      add(btree, d - 1, amt, b);
    } else {
      int p;
      scanf("%d", &p);
      p--;
      printf("%d\n", getsum(btree, 0, p - 1) + getsum(atree, p + k, n));
    }
  }
  return 0;
}
