#include <bits/stdc++.h>
using namespace std;
int n, k, x, y, q;
vector<pair<int, int> > t;
void modify(int p, int value1, int value2) {
  for (t[p += n].first = value1, t[p].second = value2; p > 1; p >>= 1) {
    t[p >> 1].first = t[p].first + t[p ^ 1].first;
    t[p >> 1].second = t[p].second + t[p ^ 1].second;
  }
}
int queryBefore(int l, int r) {
  int res = 0;
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) res += t[l++].second;
    if (r & 1) res += t[--r].second;
  }
  return res;
}
int queryAfter(int l, int r) {
  int res = 0;
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) res += t[l++].first;
    if (r & 1) res += t[--r].first;
  }
  return res;
}
int main() {
  cin >> n >> k >> x >> y >> q;
  t.resize(n << 1);
  for (int i = 0; i < q; i++) {
    int type;
    cin >> type;
    if (type == 1) {
      int a, b;
      cin >> a >> b;
      a--;
      int f, s;
      f = min(t[a + n].first + b, x);
      s = min(t[a + n].second + b, y);
      modify(a, f, s);
    } else {
      int p;
      cin >> p;
      p--;
      int ans = 0;
      ans += queryBefore(0, p) + queryAfter(p + k, n);
      cout << ans << endl;
    }
  }
  return 0;
}
