#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, m, k, type, x, y;
struct segment_tree {
  long long bound, t[N * 5];
  void update(int v, int l, int r, int pos, int val) {
    if (l == r) {
      t[v] += val;
      t[v] = min(t[v], bound);
      return;
    }
    int mid = (r + l) >> 1;
    if (pos <= mid) {
      update(v + v, l, mid, pos, val);
    } else {
      update(v + v + 1, mid + 1, r, pos, val);
    }
    t[v] = t[v + v] + t[v + v + 1];
  }
  long long get(int v, int l, int r, int tl, int tr) {
    if (l > r || l > tr || tl > r || tl > tr) {
      return 0;
    }
    if (tl <= l && r <= tr) {
      return t[v];
    }
    int mid = (r + l) >> 1;
    return get(v + v, l, mid, tl, tr) + get(v + v + 1, mid + 1, r, tl, tr);
  }
};
segment_tree t1, t2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> t2.bound >> t1.bound >> m;
  for (int i = 1; i <= m; i++) {
    cin >> type;
    if (type == 1) {
      cin >> x >> y;
      t1.update(1, 1, n, x, y);
      t2.update(1, 1, n, x, y);
    } else {
      cin >> x;
      cout << t1.get(1, 1, n, 1, x - 1) + t2.get(1, 1, n, x + k, n) << "\n";
    }
  }
}
