#include <bits/stdc++.h>
using namespace std;
long long n, k, a, b, q, x, y, p;
struct segTree {
  long long size;
  vector<long long> v;
  void init(long long x) {
    size = 1;
    while (size <= x) size *= 2;
    v.assign(size * 2, 0);
  }
  void add(long long val, long long pos, long long maxn, long long x,
           long long lx, long long rx) {
    if (rx - lx == 1) {
      v[x] += val;
      v[x] = min(v[x], maxn);
      return;
    }
    if (pos < (lx + rx) / 2)
      add(val, pos, maxn, 2 * x + 1, lx, (lx + rx) / 2);
    else
      add(val, pos, maxn, 2 * x + 2, (lx + rx) / 2, rx);
    v[x] = v[2 * x + 1] + v[2 * x + 2];
  }
  void add(long long val, long long pos, long long maxn) {
    add(val, pos, maxn, 0, 0, size);
  }
  long long range_sum(long long l, long long r, long long x, long long lx,
                      long long rx) {
    if (l <= lx && rx <= r) return v[x];
    if (lx >= r || rx <= l) return 0;
    return range_sum(l, r, 2 * x + 1, lx, (lx + rx) / 2) +
           range_sum(l, r, 2 * x + 2, (lx + rx) / 2, rx);
  }
  long long range_sum(long long l, long long r) {
    return range_sum(l, r, 0, 0, size);
  }
};
segTree before, after;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> a >> b >> q;
  before.init(n + 1);
  after.init(n + 1);
  for (long long i = 0; i < q; ++i) {
    long long t;
    cin >> t;
    if (t == 1) {
      cin >> x >> y;
      before.add(y, x, b);
      after.add(y, x, a);
    } else {
      cin >> p;
      cout << before.range_sum(1, p) + after.range_sum(min(n + 1, p + k), n + 1)
           << '\n';
    }
  }
}
