#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const long double eps = 1e-10;
struct node {
  long long cnt_days_more_a = 0;
  long long cnt_days_more_b = 0;
  long long sum_qers_less_a = 0;
  long long sum_qers_less_b = 0;
  long long sum = 0;
  node() {}
};
vector<node> v;
int k, a, b, m;
void upd(int ver) {
  v[ver].sum = v[ver * 2].sum + v[ver * 2 + 1].sum;
  v[ver].cnt_days_more_a =
      v[ver * 2].cnt_days_more_a + v[ver * 2 + 1].cnt_days_more_a;
  v[ver].cnt_days_more_b =
      v[ver * 2].cnt_days_more_b + v[ver * 2 + 1].cnt_days_more_b;
  v[ver].sum_qers_less_a =
      v[ver * 2].sum_qers_less_a + v[ver * 2 + 1].sum_qers_less_a;
  v[ver].sum_qers_less_b =
      v[ver * 2].sum_qers_less_b + v[ver * 2 + 1].sum_qers_less_b;
}
void sett(int ver, int l, int r, int d, int q) {
  if (l == r) {
    long long new_sum = v[ver].sum + q;
    if (new_sum >= a) {
      v[ver].cnt_days_more_a = 1;
      v[ver].sum_qers_less_a = 0;
    } else {
      v[ver].cnt_days_more_a = 0;
      v[ver].sum_qers_less_a = new_sum;
    }
    if (new_sum >= b) {
      v[ver].cnt_days_more_b = 1;
      v[ver].sum_qers_less_b = 0;
    } else {
      v[ver].sum_qers_less_b = 0;
      v[ver].sum_qers_less_b = new_sum;
    }
    v[ver].sum = new_sum;
    return;
  }
  int md = (l + r) / 2;
  if (d <= md) {
    sett(ver * 2, l, md, d, q);
  } else {
    sett(ver * 2 + 1, md + 1, r, d, q);
  }
  upd(ver);
}
long long get_ans_with_b(int ver, int l, int r, int x, int y) {
  if (x > y) return 0;
  if (l == x && r == y) {
    return v[ver].cnt_days_more_b * b + v[ver].sum_qers_less_b;
  }
  int md = (l + r) / 2;
  return get_ans_with_b(ver * 2, l, md, x, min(md, y)) +
         get_ans_with_b(ver * 2 + 1, md + 1, r, max(md + 1, x), y);
}
long long get_ans_with_a(int ver, int l, int r, int x, int y) {
  if (x > y) return 0;
  if (l == x && r == y) {
    return v[ver].cnt_days_more_a * a + v[ver].sum_qers_less_a;
  }
  int md = (l + r) / 2;
  return get_ans_with_a(ver * 2, l, md, x, min(md, y)) +
         get_ans_with_a(ver * 2 + 1, md + 1, r, max(md + 1, x), y);
}
int main() {
  int n;
  cin >> n;
  v.resize(4 * n);
  cin >> k >> a >> b >> m;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    if (t == 1) {
      int d, q;
      cin >> d >> q;
      sett(1, 0, n - 1, d - 1, q);
    } else {
      int f;
      cin >> f;
      f--;
      long long ans = get_ans_with_b(1, 0, n - 1, 0, f - 1) +
                      get_ans_with_a(1, 0, n - 1, f + k, n - 1);
      cout << ans << "\n";
    }
  }
}
