#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q;
pair<int, pair<int, int> > z[500500];
pair<int, pair<int, int> > add(int l, int h, int num, int val, int p = 1) {
  if (l == h) {
    pair<int, pair<int, int> > t1 = z[p];
    z[p].first += val;
    z[p].second.first = min(b, z[p].first);
    z[p].second.second = min(a, z[p].first);
    return make_pair(z[p].first - t1.first,
                     make_pair(z[p].second.first - t1.second.first,
                               z[p].second.second - t1.second.second));
  }
  pair<int, pair<int, int> > t1;
  pair<int, pair<int, int> > t2;
  if (num <= (l + h) / 2)
    t2 = add(l, (l + h) / 2, num, val, 2 * p);
  else
    t2 = add((l + h) / 2 + 1, h, num, val, 2 * p + 1);
  t1 = z[p];
  z[p].first += t2.first;
  z[p].second.first += t2.second.first;
  z[p].second.second += t2.second.second;
  return make_pair(z[p].first - t1.first,
                   make_pair(z[p].second.first - t1.second.first,
                             z[p].second.second - t1.second.second));
}
int cal(int l, int h, int a, int b, int y, int p = 1) {
  if (l == a && h == b) {
    if (y == 1) return z[p].second.first;
    return z[p].second.second;
  }
  int m = (l + h) / 2;
  if (l <= a && h >= b) {
    if (m >= b) {
      return cal(l, m, a, b, y, 2 * p);
    } else if (m + 1 <= a)
      return cal(m + 1, h, a, b, y, 2 * p + 1);
    return cal(l, m, a, m, y, 2 * p) + cal(m + 1, h, m + 1, b, y, 2 * p + 1);
  }
}
int main() {
  cin >> n >> k >> a >> b >> q;
  int x, d, y, res;
  long long m = (long long)1 << ((long long)ceil(log2(n)));
  for (int i = 0; i < q; i++) {
    scanf("%d", &x);
    if (x == 1) {
      scanf("%d%d", &d, &y);
      add(1, m, d, y);
    } else {
      scanf("%d", &d);
      res = 0;
      if (d != 1) res = cal(1, m, 1, d - 1, 1);
      if (d + k - 1 != n) res += cal(1, m, d + k, n, 2);
      cout << res << endl;
    }
  }
  return 0;
}
