#include <bits/stdc++.h>
using namespace std;
int const MAXN = 200000 + 228;
int n, t1[4 * MAXN], t2[4 * MAXN];
void build1(int a[], int v, int tl, int tr) {
  if (tl == tr)
    t1[v] = a[tl];
  else {
    int tm = (tl + tr) / 2;
    build1(a, v * 2, tl, tm);
    build1(a, v * 2 + 1, tm + 1, tr);
    t1[v] = t1[v * 2] + t1[v * 2 + 1];
  }
}
int sum1(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (l == tl && r == tr) return t1[v];
  int tm = (tl + tr) / 2;
  return sum1(v * 2, tl, tm, l, min(r, tm)) +
         sum1(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
}
void update1(int v, int tl, int tr, int pos, int new_val) {
  if (tl == tr)
    t1[v] = new_val;
  else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update1(v * 2, tl, tm, pos, new_val);
    else
      update1(v * 2 + 1, tm + 1, tr, pos, new_val);
    t1[v] = t1[v * 2] + t1[v * 2 + 1];
  }
}
void build2(int a[], int v, int tl, int tr) {
  if (tl == tr)
    t2[v] = a[tl];
  else {
    int tm = (tl + tr) / 2;
    build2(a, v * 2, tl, tm);
    build2(a, v * 2 + 1, tm + 1, tr);
    t2[v] = t2[v * 2] + t2[v * 2 + 1];
  }
}
int sum2(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (l == tl && r == tr) return t2[v];
  int tm = (tl + tr) / 2;
  return sum2(v * 2, tl, tm, l, min(r, tm)) +
         sum2(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
}
void update2(int v, int tl, int tr, int pos, int new_val) {
  if (tl == tr)
    t2[v] = new_val;
  else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update2(v * 2, tl, tm, pos, new_val);
    else
      update2(v * 2 + 1, tm + 1, tr, pos, new_val);
    t2[v] = t2[v * 2] + t2[v * 2 + 1];
  }
}
int main() {
  cin >> n;
  int k;
  cin >> k;
  int a, b;
  cin >> a >> b;
  int q;
  cin >> q;
  int D[n];
  for (int i = 0; i < n; i++) {
    D[i] = 0;
  }
  build1(D, 1, 0, n - 1);
  build2(D, 1, 0, n - 1);
  for (int i = 0; i < q; i++) {
    int x;
    cin >> x;
    if (x == 1) {
      int d, y;
      cin >> d >> y;
      d--;
      int p = sum1(1, 0, n - 1, d, d);
      update1(1, 0, n - 1, d, min(y + p, b));
      int p1 = sum2(1, 0, n - 1, d, d);
      update2(1, 0, n - 1, d, min(y + p1, a));
    } else {
      int d;
      cin >> d;
      d--;
      int sum = 0;
      if (d != 0) {
        sum = sum + sum1(1, 0, n - 1, 0, d - 1);
      }
      if (d + k <= n - 1) {
        sum = sum + sum2(1, 0, n - 1, d + k, n - 1);
      }
      cout << sum << "\n";
    }
  }
}
