#include <bits/stdc++.h>
#pragma comment(linker, "/stack:225450978")
#pragma GCC optimize("Ofast")
using namespace std;
const long long Mod = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double Pi = 3.141592653589793116, EPS = 1e-9,
                  Gold = ((1 + sqrt(5)) / 2);
long long keymod[] = {1000000007LL, 1000000009LL, 1000000021LL, 1000000033LL};
long long keyCount = sizeof(keymod) / sizeof(long long);
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcountll(s);
}
auto TimeStart = chrono::steady_clock::now();
auto TimeEnd = chrono::steady_clock::now();
void ControlIO(int argc, char* argv[]);
void TimerStart();
void TimerStop();
void Exit();
string cppstr_infile = "FILE.IN";
string cppstr_outfile = "FILE.OUT";
long long n, k, a, b, q;
vector<long long> TreeA, TreeB;
void Update(vector<long long>& Tree, long long node, long long st, long long en,
            long long id, long long x, long long lim) {
  if (st > en || en < id || id < st) return;
  if (st == en) {
    Tree[node] = min(Tree[node] + x, lim);
    return;
  }
  Update(Tree, node * 2 + 1, st, (st + en) / 2 + 0, id, x, lim);
  Update(Tree, node * 2 + 2, (st + en) / 2 + 1, en, id, x, lim);
  Tree[node] = Tree[node * 2 + 1] + Tree[node * 2 + 2];
}
long long Get(vector<long long>& Tree, long long node, long long st,
              long long en, long long L, long long R) {
  if (st > en || en < L || R < st) return 0;
  if (L <= st && en <= R) return Tree[node];
  long long p1 = Get(Tree, node * 2 + 1, st, (st + en) / 2 + 0, L, R);
  long long p2 = Get(Tree, node * 2 + 2, (st + en) / 2 + 1, en, L, R);
  return (p1 + p2);
}
void Input() {
  cin >> n >> k >> a >> b >> q;
  TreeB.resize(n * 4, 0);
  TreeA.resize(n * 4, 0);
}
void Solve() {
  while (q--) {
    long long t, d, z, p;
    cin >> t;
    if (t == 1) {
      cin >> d >> z;
      d--;
      Update(TreeA, 0, 0, n - 1, d, z, a);
      Update(TreeB, 0, 0, n - 1, d, z, b);
    } else if (t == 2) {
      cin >> p;
      p--;
      long long ans = 0;
      long long q = p + k - 1;
      if (p > 0) ans += Get(TreeB, 0, 0, n - 1, 0, p - 1);
      if (q < n - 1) ans += Get(TreeA, 0, 0, n - 1, q + 1, n - 1);
      cout << ans << '\n';
    }
  }
}
int main(int argc, char* argv[]) {
  ControlIO(argc, argv);
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  Input();
  TimerStart();
  Solve();
  TimerStop();
  return 0;
}
void ControlIO(int argc, char* argv[]) {
  char* infile = new char[cppstr_infile.size() + 1];
  char* outfile = new char[cppstr_outfile.size() + 1];
  strcpy(infile, cppstr_infile.c_str());
  strcpy(outfile, cppstr_outfile.c_str());
}
void TimerStart() {}
void TimerStop() {}
void Exit() {
  TimerStop();
  exit(0);
}
