#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 200010;
int tree[MAXN][2];
int lowbit(int x) { return x & (-x); }
void update(int x, int add, int type) {
  while (x <= MAXN) {
    tree[x][type] += add;
    x += lowbit(x);
  }
}
int sum(int x, int type) {
  int s = 0;
  while (x) {
    s += tree[x][type];
    x -= lowbit(x);
  }
  return s;
}
int main() {
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  int order[MAXN] = {0};
  for (int i = 0; i < q; ++i) {
    int op;
    cin >> op;
    if (op == 1) {
      int day, num;
      cin >> day >> num;
      int pre = order[day];
      order[day] += num;
      update(day, min(a, order[day]) - min(a, pre), 1);
      update(day, min(b, order[day]) - min(b, pre), 0);
    } else {
      int p;
      cin >> p;
      cout << sum(p - 1, 0) + sum(n, 1) - sum(p + k - 1, 1) << endl;
    }
  }
  return 0;
}
