#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 37;
const double PI = acos(-1.0);
const int MAXN = 222222;
long long segtree[4 * MAXN], a[MAXN], segtree2[4 * MAXN], a2[MAXN];
int n, q, k, A, B, type, day, v;
long long get(int x, int y, int id = 1, int le = 0, int ri = n) {
  if (x >= ri || y <= le) {
    return 0;
  }
  if (x <= le && y >= ri) {
    return segtree[id];
  }
  int mid = (le + ri) / 2;
  return get(x, y, 2 * id, le, mid) + get(x, y, 2 * id + 1, mid, ri);
}
void modify(int index, long long value, int id = 1, int le = 0, int ri = n) {
  segtree[id] -= a[index] - value;
  if (ri - le < 2) {
    a[index] = value;
    return;
  }
  int mid = (le + ri) / 2;
  if (index < mid) {
    modify(index, value, 2 * id, le, mid);
  } else {
    modify(index, value, 2 * id + 1, mid, ri);
  }
  segtree[id] = segtree[2 * id] + segtree[2 * id + 1];
}
long long get2(int x, int y, int id = 1, int le = 0, int ri = n) {
  if (x >= ri || y <= le) {
    return 0;
  }
  if (x <= le && y >= ri) {
    return segtree2[id];
  }
  int mid = (le + ri) / 2;
  return get2(x, y, 2 * id, le, mid) + get2(x, y, 2 * id + 1, mid, ri);
}
void modify2(int index, long long value, int id = 1, int le = 0, int ri = n) {
  segtree2[id] -= a2[index] - value;
  if (ri - le < 2) {
    a2[index] = value;
    return;
  }
  int mid = (le + ri) / 2;
  if (index < mid) {
    modify2(index, value, 2 * id, le, mid);
  } else {
    modify2(index, value, 2 * id + 1, mid, ri);
  }
  segtree2[id] = segtree2[2 * id] + segtree2[2 * id + 1];
}
void printA() {
  for (int i = 0; i < n; i++) {
    cout << a[i] << ' ';
  }
  cout << endl;
}
void printB() {
  for (int i = 0; i < n; i++) {
    cout << a2[i] << ' ';
  }
  cout << endl;
}
int main() {
  scanf("%d%d%d%d%d", &n, &k, &A, &B, &q);
  while (q--) {
    scanf("%d", &type);
    if (type == 1) {
      scanf("%d%d", &day, &v);
      modify(day - 1, min(1LL * B, a[day - 1] + v));
      modify2(day - 1, min(1LL * A, a2[day - 1] + v));
    } else {
      scanf("%d", &day);
      long long ans = get(0, day - 1) + get2(day + k - 1, n);
      cout << ans << endl;
    }
  }
  return 0;
}
