#include <bits/stdc++.h>
using namespace std;
int arr[200000], tree[600000][2];
int n, k, a, b, q;
void update(int node, int st, int en, int idx, int val) {
  if (st == en) {
    tree[node][0] = min(tree[node][0] + val, b);
    tree[node][1] = min(tree[node][1] + val, a);
    return;
  } else {
    int mid = (st + en) / 2;
    if (st <= idx && idx <= mid)
      update(2 * node, st, mid, idx, val);
    else
      update(2 * node + 1, mid + 1, en, idx, val);
    tree[node][0] = tree[2 * node][0] + tree[2 * node + 1][0];
    tree[node][1] = tree[2 * node][1] + tree[2 * node + 1][1];
  }
}
int query(int node, int st, int en, int shemal, int yemeen, bool type) {
  if (st > en || st > yemeen || en < shemal) return 0;
  if (shemal <= st && en <= yemeen) {
    if (!type)
      return tree[node][0];
    else
      return tree[node][1];
  }
  int mid = (st + en) / 2;
  return query(2 * node, st, mid, shemal, yemeen, type) +
         query(2 * node + 1, mid + 1, en, shemal, yemeen, type);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int a, b;
      cin >> a >> b;
      update(1, 0, n - 1, a - 1, b);
    } else {
      int a;
      cin >> a;
      cout << query(1, 0, n - 1, 0, a - 2, 0) +
                  query(1, 0, n - 1, a + k - 1, n - 1, 1)
           << '\n';
    }
  }
  return 0;
}
