#include <bits/stdc++.h>
using namespace std;
mt19937 gen(time(NULL));
int bit[100 * 100];
const double eps = 1e-9;
const int inf = 1e9;
const int mod = 1e9 + 7;
const long long infinity = 1e15;
long long t_a[4 * 200007], t_b[4 * 200007];
long long a, b;
int n, k, q;
void upd_a(int u, int l, int r, int i, int x) {
  if (l == r - 1) return void(t_a[u] = min(t_a[u] + x, a));
  int m = ((l + r) / 2);
  if (i < m)
    upd_a(2 * u + 1, l, m, i, x);
  else
    upd_a(2 * u + 2, m, r, i, x);
  t_a[u] = t_a[2 * u + 1] + t_a[2 * u + 2];
}
void upd_b(int u, int l, int r, int i, int x) {
  if (l == r - 1) return void(t_b[u] = min(t_b[u] + x, b));
  int m = ((l + r) / 2);
  if (i < m)
    upd_b(2 * u + 1, l, m, i, x);
  else
    upd_b(2 * u + 2, m, r, i, x);
  t_b[u] = t_b[2 * u + 1] + t_b[2 * u + 2];
}
long long get_a(int u, int l, int r, int L, int R) {
  if (L >= R) return 0;
  if (l == L && r == R) return t_a[u];
  int m = ((l + r) / 2);
  long long sum = 0;
  if (L < m) sum += get_a(2 * u + 1, l, m, L, min(m, R));
  if (R > m) sum += get_a(2 * u + 2, m, r, max(L, m), R);
  return sum;
}
long long get_b(int u, int l, int r, int L, int R) {
  if (L >= R) return 0;
  if (l == L && r == R) return t_b[u];
  int m = ((l + r) / 2);
  long long sum = 0;
  if (L < m) sum += get_b(2 * u + 1, l, m, L, min(m, R));
  if (R > m) sum += get_b(2 * u + 2, m, r, max(L, m), R);
  return sum;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k >> a >> b >> q;
  int t, d, p2;
  for (int i = 0; i < q; i++) {
    cin >> t;
    if (t == 1) {
      cin >> d >> p2;
      d--;
      upd_a(0, 0, n, d, p2);
      upd_b(0, 0, n, d, p2);
    } else {
      cin >> p2;
      cout << (get_b(0, 0, n, 0, p2 - 1) + get_a(0, 0, n, p2 + k - 1, n))
           << '\n';
    }
  }
}
