#include <bits/stdc++.h>
using namespace std;
long long n, k, a, b, q, f[800005][2], t, t1, t2, ret, le;
void up(int x, int l, int r, int ll, long long val, int o) {
  if (l > r || l > ll || r < ll) return;
  if (l == ll && r == ll) {
    f[x][o] += val;
    if (o && f[x][o] > a - b) f[x][o] = a - b;
    if (!o && f[x][o] > b) {
      le = f[x][o] - b;
      f[x][o] = b;
    }
    return;
  }
  int md = (l + r) / 2;
  up(x * 2, l, md, ll, val, o);
  up(x * 2 + 1, md + 1, r, ll, val, o);
  f[x][o] = f[x * 2][o] + f[x * 2 + 1][o];
}
long long que(int x, int l, int r, int ll, int rr, int o) {
  if (ll > rr || l > r || l > rr || r < ll) return 0;
  if (l >= ll && r <= rr) return f[x][o];
  int md = (l + r) / 2;
  return que(x * 2, l, md, ll, rr, o) + que(x * 2 + 1, md + 1, r, ll, rr, o);
}
int main() {
  scanf("%lld %lld %lld %lld %lld", &n, &k, &a, &b, &q);
  while (q--) {
    scanf("%lld", &t);
    if (t == 1) {
      scanf("%lld %lld", &t1, &t2);
      le = 0;
      up(1, 1, n, t1, min(t2, b), 0);
      le += max(t2 - b, 0ll);
      up(1, 1, n, t1, le, 1);
    } else {
      scanf("%lld", &t1);
      ret = 0;
      ret += que(1, 1, n, 1, t1 - 1, 0);
      ret += que(1, 1, n, t1 + k, n, 1) + que(1, 1, n, t1 + k, n, 0);
      printf("%lld\n", ret);
    }
  }
}
