#include <bits/stdc++.h>
using namespace std;
vector<long long> tree1(800005, 0);
vector<long long> tree2(800005, 0);
long long a, b, k;
void update(int node, int s, int e, int i, long long v) {
  if (s == e) {
    tree1[node] = min((tree1[node] + v), b);
    tree2[node] = min((tree2[node] + v), a);
  } else {
    int mid = (s + e) / 2;
    if (i >= s && i <= mid) {
      update(2 * node, s, mid, i, v);
    } else if (i >= mid && i <= e) {
      update((2 * node) + 1, mid + 1, e, i, v);
    }
    tree1[node] = tree1[2 * node] + tree1[(2 * node) + 1];
    tree2[node] = tree2[2 * node] + tree2[(2 * node) + 1];
  }
}
long long query(int node, int s, int e, int l, int r, bool type) {
  if (l > r || r < s || l > e) return 0;
  if (l <= s && e <= r) {
    if (type == 0)
      return tree1[node];
    else
      return tree2[node];
  }
  int mid = (s + e) / 2;
  long long p1 = query(2 * node, s, mid, l, r, type);
  long long p2 = query((2 * node) + 1, mid + 1, e, l, r, type);
  return (p1 + p2);
}
int main() {
  int n, q, t, d;
  long long p;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    cin >> t;
    if (t == 1) {
      cin >> d >> p;
      update(1, 0, n - 1, d - 1, p);
    } else {
      cin >> p;
      long long res;
      p--;
      res =
          query(1, 0, n - 1, 0, p - 1, 0) + query(1, 0, n - 1, p + k, n - 1, 1);
      cout << res << endl;
    }
  }
  return 0;
}
