#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
const int maxn = 2e5 + 5;
long long ft[maxn][2];
int ords[maxn][2];
void upd(int x, int val, int i) {
  while (x < maxn) {
    ft[x][i] += val;
    x += x & (-x);
  }
}
long long get(int x, int i) {
  long long ret = 0;
  while (x > 0) {
    ret += ft[x][i];
    x -= x & (-x);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, a, b, q;
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int tip;
    cin >> tip;
    if (tip == 1) {
      int day, orders;
      cin >> day >> orders;
      int nxt1 = ords[day][0] + orders;
      nxt1 = min(nxt1, b);
      int nxt2 = ords[day][1] + orders;
      nxt2 = min(nxt2, a);
      upd(day, nxt1 - ords[day][0], 0);
      upd(day, nxt2 - ords[day][1], 1);
      ords[day][0] = nxt1;
      ords[day][1] = nxt2;
    } else {
      int day;
      cin >> day;
      long long sum1 = get(day - 1, 0);
      long long sum2 = get(n, 1) - get(day + k - 1, 1);
      cout << sum1 + sum2 << "\n";
    }
  }
}
