#include <bits/stdc++.h>
using namespace std;
const int maxn = 8e5;
int values[maxn];
int val[2][maxn];
int id;
int A, B, X;
void add(int i, int l, int r) {
  if (l > B || r < A) return;
  if (l >= A && r <= B) {
    val[id][i] = X;
    return;
  }
  int m = (l + r) / 2;
  add(2 * i, l, m);
  add(2 * i + 1, m + 1, r);
  val[id][i] = val[id][2 * i] + val[id][2 * i + 1];
}
int sum(int i, int l, int r) {
  if (l > B || r < A) return 0;
  if (l >= A && r <= B) return val[id][i];
  int m = (l + r) / 2;
  return sum(2 * i, l, m) + sum(2 * i + 1, m + 1, r);
}
int main() {
  ::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int x;
      cin >> A >> x;
      --A;
      B = A;
      values[A] += x;
      if (values[A] > a)
        X = a;
      else
        X = values[A];
      id = 0;
      add(1, 0, n - 1);
      if (values[A] > b)
        X = b;
      else
        X = values[A];
      id = 1;
      add(1, 0, n - 1);
    } else {
      int pos;
      cin >> pos;
      --pos;
      int sum = 0;
      if (pos != 0) {
        A = 0;
        B = pos - 1;
        id = 1;
        sum += ::sum(1, 0, n - 1);
      }
      if (pos != n - k) {
        A = pos + k;
        B = n - 1;
        id = 0;
        sum += ::sum(1, 0, n - 1);
      }
      cout << sum << endl;
    }
  }
  return 0;
}
