#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
const ld PI = acos(-1);
template <typename T>
inline T mini(T& x, T y) {
  return x = min(x, y);
}
template <typename T>
inline T maxi(T& x, T y) {
  return x = max(x, y);
}
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T, typename U>
std::ostream& operator<<(std::ostream& stream, const pair<T, U>& p) {
  return stream << p.first << " " << p.second;
}
template <typename T>
std::ostream& operator<<(std::ostream& out, const vector<T>& vec) {
  for (const T& x : vec) out << x << ' ';
  return out;
}
template <typename T>
std::istream& operator>>(std::istream& in, vector<T>& vec) {
  for (auto& x : vec) in >> x;
  return in;
}
template <typename T>
class fenwick {
 public:
  vector<T> bit;
  int n{};
  int LOGN{};
  explicit fenwick(int _n, T def = T{}) : n(_n), LOGN(log2(_n)) {
    bit.resize(n, def);
  }
  explicit fenwick(const vector<T>& arr) : fenwick(arr.size()) {
    for (size_t i = 0; i < arr.size(); ++i) {
      update(i, arr[i]);
    }
  }
  void update(int idx, T delta) {
    while (idx < n) {
      bit[idx] += delta;
      idx |= (idx + 1);
    }
  }
  void update(int l, int r, T delta) {
    update(l, delta);
    update(r + 1, -delta);
  }
  T query(int idx) {
    T res{};
    while (idx >= 0) {
      res += bit[idx];
      idx = (idx & (idx + 1)) - 1;
    }
    return res;
  }
  T query(int l, int r) { return query(r) - (l > 0 ? query(l - 1) : T{}); }
  bool set(int p, T val) {
    T curr = query(p);
    if (val == curr) return false;
    update(p, val - curr);
    return true;
  }
  int lower_bound(T val) {
    T sum = 0;
    int pos = 0;
    for (int i = LOGN; i >= 0; --i) {
      int curr = pos + (1ll << i) - 1;
      if (curr < n && sum + bit[curr] < val) {
        sum += bit[curr];
        pos += 1 << i;
      }
    }
    return pos;
  }
  int upper_bound(T val) {
    int pos = 0;
    for (int i = LOGN; i >= 0; --i) {
      int curr = pos + (1ll << i) - 1;
      if (curr < n && bit[curr] <= val) {
        val -= bit[curr];
        pos += 1 << i;
      }
    }
    return pos;
  }
};
class BFactoryRepairs {
 public:
  void solve() {
    int n, k, q;
    ll a, b;
    cin >> n >> k >> a >> b >> q;
    vector<ll> cnt(n, 0);
    fenwick<ll> ta(n, 0);
    fenwick<ll> tb(n, 0);
    while (q--) {
      int type;
      cin >> type;
      if (type == 1) {
        int day;
        ll orders;
        cin >> day >> orders;
        day--;
        if (cnt[day] <= a) {
          ta.update(day, min(a - cnt[day], orders));
        }
        if (cnt[day] <= b) {
          tb.update(day, min(b - cnt[day], orders));
        }
        cnt[day] += orders;
      } else {
        int day;
        cin >> day;
        day--;
        cout << ta.query(day + k, n - 1) + tb.query(0, day - 1) << '\n';
      }
    }
  }
};
int32_t main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  BFactoryRepairs solver;
  solver.solve();
  return 0;
}
