#include <bits/stdc++.h>
using namespace std;
long long st1[800005], st2[800005], x[200005], y[200005];
long long a, b;
void update(int ss, int se, int ind, int i) {
  if (ss > se || se < ind || ss > ind) return;
  if (ss == se && ss == ind) {
    st1[i] = x[ss];
    st2[i] = y[ss];
    return;
  }
  int mid = (ss + se) / 2;
  update(ss, mid, ind, 2 * i + 1);
  update(mid + 1, se, ind, 2 * i + 2);
  st1[i] = st1[2 * i + 1] + st1[2 * i + 2];
  st2[i] = st2[2 * i + 1] + st2[2 * i + 2];
}
long long query1(int ss, int se, int l, int r, int i) {
  if (ss > se || l > se || ss > r) return 0LL;
  if (ss >= l && se <= r) return st1[i];
  int mid = (ss + se) / 2;
  return query1(ss, mid, l, r, 2 * i + 1) +
         query1(mid + 1, se, l, r, 2 * i + 2);
}
long long query2(int ss, int se, int l, int r, int i) {
  if (ss > se || l > se || ss > r) return 0LL;
  if (ss >= l && se <= r) return st2[i];
  int mid = (ss + se) / 2;
  return query2(ss, mid, l, r, 2 * i + 1) +
         query2(mid + 1, se, l, r, 2 * i + 2);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k, q;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int a1, d;
      cin >> d >> a1;
      x[d - 1] = min(x[d - 1] + a1, a);
      y[d - 1] = min(y[d - 1] + a1, b);
      update(0, n - 1, d - 1, 0);
    } else {
      int p;
      cin >> p;
      p--;
      long long temp = 0;
      if (p - 1 >= 0) temp += query2(0, n - 1, 0, p - 1, 0);
      if (p + k <= n - 1) temp += query1(0, n - 1, p + k, n - 1, 0);
      cout << temp << "\n";
    }
  }
}
