#include <bits/stdc++.h>
using namespace std;
int n, k, a, b, q;
int t, x, y;
long long dp1[5 * 200000] = {0};
long long dp2[5 * 200000] = {0};
void update(int i = 1, int l = 1, int r = n) {
  if (l == r) {
    dp1[i] += y;
    dp2[i] += y;
    if (dp1[i] > b) dp1[i] = b;
    if (dp2[i] > a) dp2[i] = a;
  } else {
    int mid = (l + r) / 2;
    if (x >= l && x <= mid)
      update(i * 2, l, mid);
    else
      update(i * 2 + 1, mid + 1, r);
    dp1[i] = dp1[i * 2] + dp1[i * 2 + 1];
    dp2[i] = dp2[i * 2] + dp2[i * 2 + 1];
  }
}
int L, R;
long long query(bool type, int i = 1, int l = 1, int r = n) {
  if (L <= l && R >= r) {
    if (!type)
      return dp1[i];
    else
      return dp2[i];
  } else if (R < l || r < L)
    return 0;
  else {
    int mid = (l + r) / 2;
    return query(type, i * 2, l, mid) + query(type, i * 2 + 1, mid + 1, r);
  }
}
int main() {
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    scanf("%d %d", &t, &x);
    if (t == 1) {
      scanf("%d", &y);
      update();
    } else {
      long long res = 0;
      if (x == 1) {
        L = k + 1;
        R = n;
        res = query(1);
      } else {
        L = 1;
        R = x - 1;
        res = query(0);
        L = x + k;
        R = n;
        res += query(1);
      }
      cout << res << endl;
    }
  }
}
