#include <bits/stdc++.h>
using namespace std;
long num_day, repair_time, before, after, ques;
long adj;
long day, num_product;
long starting_day, finishing_day;
long ans;
long it_before[1000005], it_after[1000005];
void update_before(long k, long l, long r, long i, long val) {
  if (l > i || r < i) return;
  if (l == r && l == i) {
    it_before[k] += val;
    it_before[k] = min(it_before[k], before);
    return;
  }
  long mid = (l + r) / 2;
  update_before(k * 2, l, mid, i, val);
  update_before(k * 2 + 1, mid + 1, r, i, val);
  it_before[k] = it_before[k * 2] + it_before[k * 2 + 1];
}
void update_after(long k, long l, long r, long i, long val) {
  if (l > i || r < i) return;
  if (l == r && l == i) {
    it_after[k] += val;
    it_after[k] = min(it_after[k], after);
    return;
  }
  long mid = (l + r) / 2;
  update_after(k * 2, l, mid, i, val);
  update_after(k * 2 + 1, mid + 1, r, i, val);
  it_after[k] = it_after[k * 2] + it_after[k * 2 + 1];
}
long get_before(long k, long l, long r, long L, long R) {
  if (l > R || r < L) return 0;
  if (L <= l && r <= R) return it_before[k];
  long mid = (l + r) / 2;
  return get_before(k * 2, l, mid, L, R) +
         get_before(k * 2 + 1, mid + 1, r, L, R);
}
long get_after(long k, long l, long r, long L, long R) {
  if (l > R || r < L) return 0;
  if (L <= l && r <= R) return it_after[k];
  long mid = (l + r) / 2;
  return get_after(k * 2, l, mid, L, R) +
         get_after(k * 2 + 1, mid + 1, r, L, R);
}
int main() {
  cin >> num_day >> repair_time >> after >> before >> ques;
  while (ques--) {
    cin >> adj;
    if (adj == 1) {
      cin >> day >> num_product;
      update_before(1, 1, num_day, day, num_product);
      update_after(1, 1, num_day, day, num_product);
    } else {
      cin >> starting_day;
      finishing_day = starting_day + repair_time - 1;
      ans = 0;
      if (starting_day > 1)
        ans += get_before(1, 1, num_day, 1, starting_day - 1);
      if (finishing_day < num_day)
        ans += get_after(1, 1, num_day, finishing_day + 1, num_day);
      cout << ans << endl;
    }
  }
}
