#include <bits/stdc++.h>
using namespace std;
struct node {
  int ans, extra;
  node() { ans = extra = 0; }
} treeb[1 << 20], treea[1 << 20];
int a, b, n, k, q, c;
int cmd, d;
void build(int x, int l, int r) {
  if (l == r) {
    treeb[x].extra = b;
    treeb[x].ans = 0;
    return;
  }
  int mid = (l + r) / 2;
  build(2 * x, l, mid);
  build(2 * x + 1, mid + 1, r);
  treeb[x].extra = b * (r - l + 1);
  treeb[x].ans = 0;
}
void update(int x, int l, int r) {
  if (l > d || r < d) return;
  if (l == r) {
    int y = min(c, treeb[x].extra);
    treeb[x].ans += y;
    treeb[x].extra -= y;
    y = min(c, treea[x].extra);
    treea[x].ans += y;
    treea[x].extra -= y;
    return;
  }
  int mid = (l + r) / 2;
  update(2 * x, l, mid);
  update(2 * x + 1, mid + 1, r);
  treeb[x].ans = treeb[2 * x].ans + treeb[2 * x + 1].ans;
  treea[x].ans = treea[2 * x].ans + treea[2 * x + 1].ans;
}
int st, en;
int queryb(int x, int l, int r) {
  if (l > en || r < st) return 0;
  if (l >= st && r <= en) return treeb[x].ans;
  int mid = (l + r) / 2;
  return queryb(2 * x, l, mid) + queryb(2 * x + 1, mid + 1, r);
}
int querya(int x, int l, int r) {
  if (l > en || r < st) return 0;
  if (l >= st && r <= en) return treea[x].ans;
  int mid = (l + r) / 2;
  return querya(2 * x, l, mid) + querya(2 * x + 1, mid + 1, r);
}
int main() {
  cin >> n >> k >> a >> b >> q;
  build(1, 1, n);
  swap(a, b);
  swap(treeb, treea);
  build(1, 1, n);
  swap(a, b);
  swap(treeb, treea);
  int x1, x2;
  while (q--) {
    scanf("%d", &cmd);
    if (cmd == 1) {
      scanf("%d%d", &d, &c);
      update(1, 1, n);
    } else {
      scanf("%d", &d);
      x1 = x2 = 0;
      st = 1, en = d - 1;
      if (st <= en) x1 = queryb(1, 1, n);
      st = d + k, en = n;
      if (st <= en) x2 = querya(1, 1, n);
      printf("%d\n", x1 + x2);
    }
  }
}
