#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const double EPS = 1e-7;
const double PI = acos(-1.0);
const long long INF = (long long)2e9 + 1;
const long long LINF = (long long)8e18;
const long long MM = (long long)1e9 + 7;
int solve();
void gen();
int main() {
  solve();
  return 0;
}
const int MAXN = 2e5 + 7;
const int MAXC = 5e7;
long long n, k, a, b, q;
long long T[4 * MAXN];
long long TT[4 * MAXN];
void update(int v, int tl, int tr, int pos, long long val) {
  if (tl == tr) {
    T[v] = val;
  } else {
    int tm = (tl + tr) / 2;
    if (tm >= pos) {
      update(v * 2, tl, tm, pos, val);
    } else
      update(v * 2 + 1, tm + 1, tr, pos, val);
    T[v] = T[v * 2] + T[v * 2 + 1];
  }
}
long long get(int v, int tl, int tr, int l, int r) {
  if (l == tl && r == tr) {
    return T[v];
  } else {
    int tm = (tl + tr) / 2;
    if (r <= tm) {
      return get(v * 2, tl, tm, l, r);
    } else if (tm < l) {
      return get(v * 2 + 1, tm + 1, tr, l, r);
    }
    return (get(v * 2, tl, tm, l, tm) + get(v * 2 + 1, tm + 1, tr, tm + 1, r));
  }
}
void update2(int v, int tl, int tr, int pos, long long val) {
  if (tl == tr) {
    TT[v] = val;
  } else {
    int tm = (tl + tr) / 2;
    if (tm >= pos) {
      update2(v * 2, tl, tm, pos, val);
    } else
      update2(v * 2 + 1, tm + 1, tr, pos, val);
    TT[v] = TT[v * 2] + TT[v * 2 + 1];
  }
}
long long get2(int v, int tl, int tr, int l, int r) {
  if (l == tl && r == tr) {
    return TT[v];
  } else {
    int tm = (tl + tr) / 2;
    if (r <= tm) {
      return get2(v * 2, tl, tm, l, r);
    } else if (tm < l) {
      return get2(v * 2 + 1, tm + 1, tr, l, r);
    }
    return (get2(v * 2, tl, tm, l, tm) +
            get2(v * 2 + 1, tm + 1, tr, tm + 1, r));
  }
}
int solve() {
  cin >> n >> k >> a >> b >> q;
  vector<long long> TTT(n);
  while (q--) {
    int w;
    scanf("%d", &w);
    if (w == 1) {
      int d, q;
      scanf("%d%d", &d, &q);
      TTT[d - 1] += q;
      update(1, 0, n - 1, d - 1, min(TTT[d - 1], a * 1LL));
      update2(1, 0, n - 1, d - 1, min(TTT[d - 1], b * 1LL));
    } else {
      int p;
      scanf("%d", &p);
      if (p == 1) {
        if (p + k - 1 >= n) {
          printf("0\n");
        } else {
          printf("%d\n", get(1, 0, n - 1, p + k - 1, n - 1));
        }
      } else {
        if (p + k - 1 >= n) {
          printf("%d\n", get2(1, 0, n - 1, 0, p - 2));
        } else {
          printf("%d\n", get2(1, 0, n - 1, 0, p - 2) +
                             get(1, 0, n - 1, p + k - 1, n - 1));
        }
      }
    }
  }
  return 0;
}
