#include <bits/stdc++.h>
using namespace std;
long long tree[2][1000009];
int n, k, a, b, q;
long long arr1[1000009];
long long arr2[1000009];
void UPD(int x, int val) {
  long long num;
  if (val >= b - arr1[x]) {
    num = b - arr1[x];
  } else {
    num = val;
  }
  arr1[x] += num;
  for (int i = x; i <= n; i += (i & (-i))) {
    tree[0][i] += num;
  }
  if (val >= a - arr2[x]) {
    num = a - arr2[x];
  } else {
    num = val;
  }
  arr2[x] += num;
  for (; x <= n; x += (x & (-x))) {
    tree[1][x] += num;
  }
}
long long query(int x, int type) {
  long long ans = 0;
  for (; x > 0; x -= (x & (-x))) ans += tree[type][x];
  return ans;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int d, val;
      cin >> d >> val;
      UPD(d, val);
    } else {
      int x;
      cin >> x;
      long long a1 = query(x - 1, 0), a2 = query(n, 1),
                a3 = query(x + k - 1, 1);
      cout << a1 + (a2 - a3) << endl;
    }
  }
}
