#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
long long A[maxn], suma[maxn << 2], sumb[maxn << 2];
int n, k, a, b, q;
void update1(int index, long long val, int l, int r, int rt) {
  if (l == r) {
    suma[rt] = A[l] > a ? a : A[l];
    return;
  }
  int mid = (l + r) >> 1;
  if (index <= mid)
    update1(index, val, l, mid, rt << 1);
  else
    update1(index, val, mid + 1, r, rt << 1 | 1);
  suma[rt] = suma[rt << 1] + suma[rt << 1 | 1];
}
void update2(int index, long long val, int l, int r, int rt) {
  if (l == r) {
    sumb[rt] = A[l] > b ? b : A[l];
    return;
  }
  int mid = (l + r) >> 1;
  if (index <= mid)
    update2(index, val, l, mid, rt << 1);
  else
    update2(index, val, mid + 1, r, rt << 1 | 1);
  sumb[rt] = sumb[rt << 1] + sumb[rt << 1 | 1];
}
long long query1(int L, int R, int l, int r, int rt) {
  if (L > n) return 0;
  if (L <= l && R >= r) return suma[rt];
  int mid = (l + r) >> 1;
  long long ret = 0;
  if (L <= mid) ret += query1(L, R, l, mid, rt << 1);
  if (R > mid) ret += query1(L, R, mid + 1, r, rt << 1 | 1);
  return ret;
}
long long query2(int L, int R, int l, int r, int rt) {
  if (R < 1) return 0;
  if (L <= l && R >= r) return sumb[rt];
  int mid = (l + r) >> 1;
  long long ret = 0;
  if (L <= mid) ret += query2(L, R, l, mid, rt << 1);
  if (R > mid) ret += query2(L, R, mid + 1, r, rt << 1 | 1);
  return ret;
}
int main() {
  cin >> n >> k >> a >> b >> q;
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int index, flag = 0;
      long long val;
      cin >> index >> val;
      if (A[index] > b) flag = 1;
      if (A[index] > a) flag = 2;
      A[index] += val;
      if (flag == 2) continue;
      update1(index, val, 1, n, 1);
      if (flag == 1) continue;
      update2(index, val, 1, n, 1);
    } else {
      int index;
      cin >> index;
      long long ans =
          query2(1, index - 1, 1, n, 1) + query1(index + k, n, 1, n, 1);
      cout << ans << endl;
    }
  }
  return 0;
}
