#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int a, b, s[200009 << 2][3];
void upd(int p, int v, int nd, int x, int y) {
  if (x == y) {
    s[nd][0] = min(s[nd][0] + v, b);
    s[nd][1] = min(s[nd][1] + v, a);
    return;
  }
  int mid = (x + y) >> 1;
  if (p <= mid)
    upd(p, v, nd << 1, x, mid);
  else
    upd(p, v, nd << 1 | 1, mid + 1, y);
  s[nd][0] = s[nd << 1][0] + s[nd << 1 | 1][0];
  s[nd][1] = s[nd << 1][1] + s[nd << 1 | 1][1];
}
int tap(int l, int r, int tp, int nd, int x, int y) {
  if (l > y or x > r) return 0;
  if (l <= x and y <= r) return s[nd][tp];
  int mid = (x + y) >> 1;
  return tap(l, r, tp, nd << 1, x, mid) +
         tap(l, r, tp, nd << 1 | 1, mid + 1, y);
}
int main() {
  int n, k, q;
  scanf("%d%d%d%d%d", &n, &k, &a, &b, &q);
  while (q--) {
    int type, day;
    scanf("%d%d", &type, &day);
    if (type == 1) {
      int val;
      scanf("%d", &val);
      upd(day, val, 1, 1, n);
    } else
      printf("%d\n", tap(1, day - 1, 0, 1, 1, n) + tap(day + k, n, 1, 1, 1, n));
  }
  return 0;
}
