#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int finishNum, preNum;
struct node {
  int preNum, repairedNum;
  node() {
    preNum = 0;
    repairedNum = 0;
  }
} tree[maxn << 2];
void Insert(int root, int l, int r, int pos, int v) {
  if (pos > r || pos < l) return;
  if (l == r) {
    tree[root].preNum = min(v + tree[root].preNum, preNum);
    tree[root].repairedNum = min(v + tree[root].repairedNum, finishNum);
    return;
  }
  int mid = (l + r) / 2;
  Insert(root << 1, l, mid, pos, v);
  Insert(root << 1 | 1, mid + 1, r, pos, v);
  tree[root].preNum = tree[root << 1].preNum + tree[root << 1 | 1].preNum;
  tree[root].repairedNum =
      tree[root << 1].repairedNum + tree[root << 1 | 1].repairedNum;
}
int cnt;
int query(int root, int l, int r, int ql, int qr, int flag) {
  if (ql > r || qr < l) return 0;
  if (ql <= l && r <= qr) {
    if (!flag)
      return tree[root].preNum;
    else
      return tree[root].repairedNum;
  }
  int mid = (l + r) / 2;
  return query(root << 1, l, mid, ql, qr, flag) +
         query(root << 1 | 1, mid + 1, r, ql, qr, flag);
}
int main() {
  int n, repairTime, opNum;
  scanf("%d %d %d %d %d", &n, &repairTime, &finishNum, &preNum, &opNum);
  while (opNum--) {
    int op, day;
    scanf("%d", &op);
    if (op == 1) {
      int num;
      scanf("%d %d", &day, &num);
      Insert(1, 1, n, day, num);
    } else {
      scanf("%d", &day);
      int sum = 0;
      cnt = 0;
      sum += query(1, 1, n, 1, day - 1, 0);
      sum += query(1, 1, n, day + repairTime, n, 1);
      printf("%d\n", sum);
    }
  }
}
